From fa70667711b9338e7776f0597c7467ecd148588e Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 17 Aug 2023 01:52:10 -0400 Subject: [PATCH] fix(striker-ui-api): exclude deleted fences, upses, manifests from manifest template --- .../src/lib/request_handlers/manifest/getManifestTemplate.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/striker-ui-api/src/lib/request_handlers/manifest/getManifestTemplate.ts b/striker-ui-api/src/lib/request_handlers/manifest/getManifestTemplate.ts index 8a02b345..3e893be5 100644 --- a/striker-ui-api/src/lib/request_handlers/manifest/getManifestTemplate.ts +++ b/striker-ui-api/src/lib/request_handlers/manifest/getManifestTemplate.ts @@ -1,5 +1,7 @@ import { RequestHandler } from 'express'; +import { DELETED } from '../../consts'; + import { getLocalHostName, query } from '../../accessModule'; import { getHostNameDomain, @@ -52,6 +54,7 @@ export const getManifestTemplate: RequestHandler = async ( fence_uuid, fence_name FROM fences + WHERE fence_arguments != '${DELETED}' ORDER BY fence_name ) AS a FULL JOIN ( @@ -60,6 +63,7 @@ export const getManifestTemplate: RequestHandler = async ( ups_uuid, ups_name FROM upses + WHERE ups_ip_address != '${DELETED}' ORDER BY ups_name ) AS b ON a.row_number = b.row_number FULL JOIN ( @@ -69,6 +73,7 @@ export const getManifestTemplate: RequestHandler = async ( SUBSTRING(manifest_name, '([\\d]*)$') AS INTEGER ) AS last_sequence FROM manifests + WHERE manifest_note != '${DELETED}' ORDER BY manifest_name DESC LIMIT 1 ) AS c ON a.row_number = c.row_number;`,