feat: reports; improved+simplifed modals; extractError funcction;

refactor: change jwt claims to lowercase; use response dtos for sensitive data
fix: nullify user on token clears; change appsettings.dev View_Internal_API_Key
This commit is contained in:
2026-01-14 19:41:52 -05:00
parent 1da88dba4e
commit 67447d51ae
39 changed files with 2291 additions and 454 deletions
+19
View File
@@ -24,6 +24,25 @@ export function extractDateFromUUIDv7(uuid?: string): Date | null {
return new Date(parseInt(timestampHex, 16));
}
export function extractError(resData: unknown): string | null {
if (!resData || typeof resData !== 'object') return null;
const data = resData as { errors?: unknown; message?: unknown };
if (data.errors && typeof data.errors === 'object') {
return Object.values(data.errors as Record<string, unknown>)
.flat()
.filter((v) => typeof v === 'string')
.join('\n');
}
if (typeof data.message === 'string') {
return data.message;
}
return null;
}
export function dateToRelativeString(
date: Date,
useSuffix = true,