Initial commit

This commit is contained in:
hiperman
2025-12-04 00:33:37 -05:00
commit 7ca0a21283
798 changed files with 190424 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { getRequestEvent, query } from '$app/server';
import { authorQuerySchema } from '$lib/schema/author';
import { createQueryParams } from '$lib/utils';
import { error } from '@sveltejs/kit';
export const listAuthors = query(authorQuerySchema, async (data) => {
const { locals } = getRequestEvent();
const params = createQueryParams(data);
const response = await locals.api.get(`/authors?${params.toString()}`);
if (!response.ok) error(500, 'An unkown error occurred');
return await response.json();
});