fix(striker-ui-api): don't include deleted users in GET /user

main
Tsu-ba-me 2 years ago
parent a272db4239
commit 911f0322cb
  1. 5
      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 =

Loading…
Cancel
Save