260322:1648 Correct Coresspondence / Doing RFA / Correct CI
CI Pipeline / build (push) Failing after 12m41s
Build and Deploy / deploy (push) Failing after 2m44s

This commit is contained in:
admin
2026-03-22 16:48:12 +07:00
parent e5deedb42e
commit 11984bfa29
683 changed files with 105251 additions and 29068 deletions
+7 -3
View File
@@ -14,7 +14,7 @@ export interface Session {
isCurrent: boolean;
}
const extractArrayData = <T,>(value: unknown): T[] => {
const extractArrayData = <T>(value: unknown): T[] => {
let current: unknown = value;
for (let i = 0; i < 5; i += 1) {
@@ -39,8 +39,12 @@ const transformSession = (session: Session | (Omit<Session, 'id'> & { id: string
export const sessionService = {
getActiveSessions: async (): Promise<Session[]> => {
const response = await apiClient.get<Session[] | { data: Session[] } | { data: { data: Session[] } }>('/auth/sessions');
return extractArrayData<Session | (Omit<Session, 'id'> & { id: string | number })>(response.data).map(transformSession);
const response = await apiClient.get<Session[] | { data: Session[] } | { data: { data: Session[] } }>(
'/auth/sessions'
);
return extractArrayData<Session | (Omit<Session, 'id'> & { id: string | number })>(response.data).map(
transformSession
);
},
revokeSession: async (sessionId: number) => {