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 1551ecc8..f67ee5db 100644 --- a/striker-ui-api/src/lib/request_handlers/user/getUser.ts +++ b/striker-ui-api/src/lib/request_handlers/user/getUser.ts @@ -2,18 +2,22 @@ import buildGetRequestHandler from '../buildGetRequestHandler'; import { buildQueryResultReducer } from '../../buildQueryResultModifier'; export const getUser = buildGetRequestHandler((request, buildQueryOptions) => { + const { user: { uuid: sessionUserUuid } = {} } = request; + const query = ` SELECT - use.user_name, - use.user_uuid - FROM users AS use;`; + a.user_name, + a.user_uuid + FROM users AS a;`; const afterQueryReturn: QueryResultModifierFunction | undefined = buildQueryResultReducer< Record - >((previous, [userName, userUUID]) => { - previous[userUUID] = { + >((previous, [userName, userUuid]) => { + const key = userUuid === sessionUserUuid ? 'current' : userUuid; + + previous[key] = { userName, - userUUID, + userUUID: userUuid, }; return previous;