Fix non-serializable accessFilter in admin load, add error boundary and tests

This commit is contained in:
NeilClack
2026-07-17 14:52:09 -05:00
parent dd8c194de2
commit b746d89448
5 changed files with 159 additions and 4 deletions
+4 -3
View File
@@ -1,7 +1,8 @@
import type { PageServerLoad } from './$types';
import { getAllModelConfigs } from '$lib/svelte-admin/registry';
import { getSerializableModelConfigs } from '$lib/svelte-admin/registry';
export const load: PageServerLoad = async () => {
const models = getAllModelConfigs().filter((m) => m.slug !== 'license-keys');
export const load: PageServerLoad = async ({ locals }) => {
const viewerRoleId = (locals.user as { roleId?: number } | null)?.roleId ?? 4;
const models = getSerializableModelConfigs(viewerRoleId, ['license-keys']);
return { models };
};