feat: refactor department to organization and move certifications to configuration tab commit

This commit is contained in:
mengstabketemaw
2026-06-29 15:57:42 +03:00
parent 3493fbbae7
commit c46747c98e
14 changed files with 215 additions and 89 deletions

View File

@@ -23,8 +23,17 @@ export const authStorage = {
setUser: <T>(u: T) => localStorage.setItem(key('auth-user'), JSON.stringify(u)),
getProfileId: () => localStorage.getItem(key('profile-id')) ?? undefined,
setProfileId: (id: string) => localStorage.setItem(key('profile-id'), id),
getProfile: <T = unknown>(): T | null => {
try {
return JSON.parse(localStorage.getItem(key('current-profile')) ?? 'null') as T | null;
} catch {
return null;
}
},
setProfile: <T>(p: T) => localStorage.setItem(key('current-profile'), JSON.stringify(p)),
removeProfile: () => localStorage.removeItem(key('current-profile')),
clear: () => {
[key('auth-token'), key('refresh-token'), key('auth-user'), key('profile-id')].forEach((k) =>
[key('auth-token'), key('refresh-token'), key('auth-user'), key('profile-id'), key('current-profile')].forEach((k) =>
localStorage.removeItem(k),
);
document.cookie =