From 192e1b82cc023a9e6d88a90732699ceacffb8afa Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Wed, 3 May 2023 14:33:49 -0400 Subject: [PATCH] fix(striker-ui-api): add type number boolean --- .../src/lib/request_handlers/anvil/getAnvilDetail.ts | 10 ++++------ .../src/types/InsertOrUpdateVariableFunction.d.ts | 2 +- striker-ui-api/src/types/NumberBoolean.d.ts | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 striker-ui-api/src/types/NumberBoolean.d.ts diff --git a/striker-ui-api/src/lib/request_handlers/anvil/getAnvilDetail.ts b/striker-ui-api/src/lib/request_handlers/anvil/getAnvilDetail.ts index 3a260e67..024e007b 100644 --- a/striker-ui-api/src/lib/request_handlers/anvil/getAnvilDetail.ts +++ b/striker-ui-api/src/lib/request_handlers/anvil/getAnvilDetail.ts @@ -4,8 +4,6 @@ import { RequestHandler } from 'express'; import { getAnvilData, getHostData, query } from '../../accessModule'; import { stderr } from '../../shell'; -type DbBoolean = 0 | 1; - const buildHostStateMessage = (postfix = 2) => `message_022${postfix}`; export const getAnvilDetail: RequestHandler< @@ -63,10 +61,10 @@ export const getAnvilDetail: RequestHandler< if (hstatus !== 'online') continue; let rows: [ - inCcm: DbBoolean, - crmdMember: DbBoolean, - clusterMember: DbBoolean, - maintenanceMode: DbBoolean, + inCcm: NumberBoolean, + crmdMember: NumberBoolean, + clusterMember: NumberBoolean, + maintenanceMode: NumberBoolean, ][]; try { diff --git a/striker-ui-api/src/types/InsertOrUpdateVariableFunction.d.ts b/striker-ui-api/src/types/InsertOrUpdateVariableFunction.d.ts index 83e5c59c..620ea292 100644 --- a/striker-ui-api/src/types/InsertOrUpdateVariableFunction.d.ts +++ b/striker-ui-api/src/types/InsertOrUpdateVariableFunction.d.ts @@ -1,5 +1,5 @@ type VariableParams = InsertOrUpdateFunctionCommonParams & { - update_value_only?: 0 | 1; + update_value_only?: NumberBoolean; variable_default?: string; varaible_description?: string; variable_name?: string; diff --git a/striker-ui-api/src/types/NumberBoolean.d.ts b/striker-ui-api/src/types/NumberBoolean.d.ts new file mode 100644 index 00000000..c8114f7f --- /dev/null +++ b/striker-ui-api/src/types/NumberBoolean.d.ts @@ -0,0 +1 @@ +type NumberBoolean = 0 | 1;