refactor zo zod and felte

This commit is contained in:
Christian Beutel
2024-12-30 19:52:44 +01:00
parent 75c94a3ce4
commit 871481a84e
45 changed files with 659 additions and 1040 deletions

View File

@@ -7,9 +7,11 @@ import { json, type RequestEvent } from "@sveltejs/kit";
export async function GET(event: RequestEvent) {
try {
const r = await show<Comment>(event, Collection.comments)
r.expand = {
author: await pb.collection('users_anonymous').getOne(r.author)
if (!r.expand) {
r.expand = {} as any
}
r.expand!.author = await pb.collection('users_anonymous').getOne(r.author)
return json(r)
} catch (e: any) {
throw handleError(e)

View File

@@ -7,9 +7,11 @@ import { json, type RequestEvent } from "@sveltejs/kit";
export async function GET(event: RequestEvent) {
try {
const r = await show<List>(event, Collection.lists)
r.expand = {
author: await pb.collection('users_anonymous').getOne(r.author!)
if (!r.expand) {
r.expand = {} as any
}
r.expand!.author = await pb.collection('users_anonymous').getOne(r.author!)
return json(r)
} catch (e: any) {
throw handleError(e)