app: people and company @frontend added no test runned

This commit is contained in:
2025-06-25 11:56:42 +03:00
parent c259ad3d99
commit 5c640ddcee
32 changed files with 2794 additions and 81 deletions

View File

@@ -11,11 +11,8 @@ const getMenuFromRedis = async (): Promise<ClientMenu> => {
const decrpytUserSelection = await functionRetrieveUserSelection()
const redisKey = decrpytUserSelection?.redisKey;
if (!redisKey) throw new AuthError("No redis key found");
// Use safe Redis get operation with proper connection handling
const result = await safeRedisGet(`${redisKey}`, REDIS_TIMEOUT);
if (!result) throw new AuthError("No data found in redis");
// Use safe JSON parsing with proper default object type
const parsedResult = safeJsonParse(result, { menu: defaultValuesMenu });
if (!parsedResult.menu) throw new AuthError("No menu found in redis");
return parsedResult.menu;
@@ -31,12 +28,7 @@ const setMenuToRedis = async (menuObject: string[]) => {
if (!menuObject) throw new AuthError("No menu object provided");
const oldData = await getCompleteFromRedis();
if (!oldData) throw new AuthError("No old data found in redis");
await setCompleteToRedis({
...oldData, menu: {
...oldData.menu,
selectionList: menuObject,
}
});
await setCompleteToRedis({ ...oldData, menu: { ...oldData.menu, selectionList: menuObject } });
return true;
} catch (error) { if (error instanceof AuthError) { throw error } else { throw new AuthError(error instanceof Error ? error.message : "Unknown error") } }
}