mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 11:03:44 +00:00
chore(*): Fix remaining PR comments
This commit is contained in:
@@ -32,21 +32,16 @@ export const GET = async (event: RequestEvent) => {
|
||||
|
||||
export const PUT = async (event: RequestEvent) => {
|
||||
try {
|
||||
console.log('PUT request received for catch-records');
|
||||
|
||||
// Check if we can get a session first
|
||||
const { session, user } = await event.locals.safeGetSession();
|
||||
console.log('Session check:', { hasSession: !!session, hasUser: !!user, userId: user?.id });
|
||||
|
||||
const userId = await requireAuth(event);
|
||||
console.log('Auth successful, userId:', userId);
|
||||
|
||||
const data: Partial<CatchRecord> = await event.request.json();
|
||||
|
||||
// Get the user's session and set it on the Supabase client
|
||||
if (session) {
|
||||
await event.locals.supabase.auth.setSession(session);
|
||||
console.log('Session set on Supabase client');
|
||||
}
|
||||
|
||||
// Ensure the userId is set to the authenticated user
|
||||
|
||||
Reference in New Issue
Block a user