From 911f0322cbe10e2425745e82325d35b385efe716 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Mon, 19 Jun 2023 02:50:11 -0400 Subject: [PATCH] fix(striker-ui-api): don't include deleted users in GET /user --- striker-ui-api/src/lib/request_handlers/user/getUser.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/striker-ui-api/src/lib/request_handlers/user/getUser.ts b/striker-ui-api/src/lib/request_handlers/user/getUser.ts index 0d2d0d07..2bd997f6 100644 --- a/striker-ui-api/src/lib/request_handlers/user/getUser.ts +++ b/striker-ui-api/src/lib/request_handlers/user/getUser.ts @@ -1,3 +1,5 @@ +import { DELETED } from '../../consts'; + import buildGetRequestHandler from '../buildGetRequestHandler'; import { buildQueryResultReducer } from '../../buildQueryResultModifier'; @@ -8,7 +10,7 @@ export const getUser = buildGetRequestHandler((request, buildQueryOptions) => { let condLimitRegular = ''; if (sessionUserName !== 'admin') { - condLimitRegular = `WHERE user_uuid = '${sessionUserUuid}'`; + condLimitRegular = `AND user_uuid = '${sessionUserUuid}'`; } const query = ` @@ -16,6 +18,7 @@ export const getUser = buildGetRequestHandler((request, buildQueryOptions) => { a.user_name, a.user_uuid FROM users AS a + WHERE a.user_algorithm != '${DELETED}' ${condLimitRegular};`; const afterQueryReturn: QueryResultModifierFunction | undefined =