import { redirect } from '@sveltejs/kit';
import type { LayoutServerLoad } from './$types';

export const load: LayoutServerLoad = async ({ parent }) => {
	const { member } = await parent();

	// Only board and admin can access board pages
	if (member?.role !== 'board' && member?.role !== 'admin') {
		throw redirect(303, '/dashboard');
	}

	return {};
};
