fix(striker-ui-api): add type number boolean

main
Tsu-ba-me 2 years ago
parent 83d572530b
commit 192e1b82cc
  1. 10
      striker-ui-api/src/lib/request_handlers/anvil/getAnvilDetail.ts
  2. 2
      striker-ui-api/src/types/InsertOrUpdateVariableFunction.d.ts
  3. 1
      striker-ui-api/src/types/NumberBoolean.d.ts

@ -4,8 +4,6 @@ import { RequestHandler } from 'express';
import { getAnvilData, getHostData, query } from '../../accessModule'; import { getAnvilData, getHostData, query } from '../../accessModule';
import { stderr } from '../../shell'; import { stderr } from '../../shell';
type DbBoolean = 0 | 1;
const buildHostStateMessage = (postfix = 2) => `message_022${postfix}`; const buildHostStateMessage = (postfix = 2) => `message_022${postfix}`;
export const getAnvilDetail: RequestHandler< export const getAnvilDetail: RequestHandler<
@ -63,10 +61,10 @@ export const getAnvilDetail: RequestHandler<
if (hstatus !== 'online') continue; if (hstatus !== 'online') continue;
let rows: [ let rows: [
inCcm: DbBoolean, inCcm: NumberBoolean,
crmdMember: DbBoolean, crmdMember: NumberBoolean,
clusterMember: DbBoolean, clusterMember: NumberBoolean,
maintenanceMode: DbBoolean, maintenanceMode: NumberBoolean,
][]; ][];
try { try {

@ -1,5 +1,5 @@
type VariableParams = InsertOrUpdateFunctionCommonParams & { type VariableParams = InsertOrUpdateFunctionCommonParams & {
update_value_only?: 0 | 1; update_value_only?: NumberBoolean;
variable_default?: string; variable_default?: string;
varaible_description?: string; varaible_description?: string;
variable_name?: string; variable_name?: string;

@ -0,0 +1 @@
type NumberBoolean = 0 | 1;
Loading…
Cancel
Save