|
|
|
@ -1,6 +1,7 @@
|
|
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
|
|
|
|
|
|
|
|
export const load: PageServerLoad = async (event) => {
|
|
|
|
export const load: PageServerLoad = async (event) => {
|
|
|
|
|
|
|
|
const userId = event.locals.userId ?? null;
|
|
|
|
const res = await event.fetch('/api/me/groups', { headers: { 'cache-control': 'no-store' } });
|
|
|
|
const res = await event.fetch('/api/me/groups', { headers: { 'cache-control': 'no-store' } });
|
|
|
|
if (!res.ok) {
|
|
|
|
if (!res.ok) {
|
|
|
|
// El gate del layout debería impedir llegar aquí sin sesión; devolvemos vacío como salvaguarda.
|
|
|
|
// El gate del layout debería impedir llegar aquí sin sesión; devolvemos vacío como salvaguarda.
|
|
|
|
@ -30,5 +31,5 @@ export const load: PageServerLoad = async (event) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return { groups, itemsByGroup, unassignedFirst };
|
|
|
|
return { groups, itemsByGroup, unassignedFirst, userId };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|