refactor zo zod and felte
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user