From 31348cb6d1dc7f26e9dd8cf9792e02a026dcc0f2 Mon Sep 17 00:00:00 2001 From: Hymmel Date: Wed, 21 Jan 2026 11:57:02 +0100 Subject: [PATCH] fix: syntax error in AuthContext --- Frontend/lib/auth-context.tsx | 81 ++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/Frontend/lib/auth-context.tsx b/Frontend/lib/auth-context.tsx index 3a9275d..a58897e 100644 --- a/Frontend/lib/auth-context.tsx +++ b/Frontend/lib/auth-context.tsx @@ -177,46 +177,49 @@ export function AuthProvider({ children }: { children: ReactNode }) { } } catch (e) { console.error(e) - const deleteTicket = useCallback(async (ticketId: number) => { - if (!authHeader) return - try { - const res = await fetch(`${API_URL}/tickets/${ticketId}`, { - method: "DELETE", - headers: { "Authorization": authHeader } - }) - if (res.ok) { - fetchTickets(authHeader) - } - } catch (e) { - console.error(e) - } - }, [authHeader, fetchTickets]) - - return ( - - {children} - - ) } + }, [authHeader, fetchTickets]) - export function useAuth() { - const context = useContext(AuthContext) - if (!context) { - throw new Error("useAuth must be used within an AuthProvider") + const deleteTicket = useCallback(async (ticketId: number) => { + if (!authHeader) return + try { + const res = await fetch(`${API_URL}/tickets/${ticketId}`, { + method: "DELETE", + headers: { "Authorization": authHeader } + }) + if (res.ok) { + fetchTickets(authHeader) } - return context + } catch (e) { + console.error(e) } + }, [authHeader, fetchTickets]) + + return ( + + {children} + + ) +} + +export function useAuth() { + const context = useContext(AuthContext) + if (!context) { + throw new Error("useAuth must be used within an AuthProvider") + } + return context +}