mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-12 21:08:46 +00:00
15 lines
498 B
TypeScript
15 lines
498 B
TypeScript
import { error } from "@sveltejs/kit";
|
|
import { callPostApi } from "$lib/hooks";
|
|
import type { MissingThumbnailFileScanResponse } from "$lib/server/schemas";
|
|
import type { PageLoad } from "./$types";
|
|
|
|
export const load: PageLoad = async ({ fetch }) => {
|
|
const res = await callPostApi("/api/file/scanMissingThumbnails", undefined, fetch);
|
|
if (!res.ok) {
|
|
error(500, "Internal server error");
|
|
}
|
|
|
|
const { files }: MissingThumbnailFileScanResponse = await res.json();
|
|
return { files };
|
|
};
|