import { getQuestionsAllQueryOptions } from "@/modules/assessmentManagement/queries/assessmentQueries.ts";
import { createFileRoute } from "@tanstack/react-router";
import { z } from "zod";

const searchParamSchema = z.object({
	create: z.boolean().default(false).optional(),
	edit: z.string().default("").optional(),
	delete: z.string().default("").optional(),
	detail: z.string().default("").optional(),
});

export const Route = createFileRoute("/_dashboardLayout/assessment/")({
	validateSearch: searchParamSchema,

	loader: ({ context: { queryClient } }) => {
		queryClient.ensureQueryData(getQuestionsAllQueryOptions(0, 10));
	},
});
