25 lines
840 B
TypeScript
25 lines
840 B
TypeScript
import Pocketbase from "pocketbase"
|
|
import { POCKETBASE_URL } from "$env/static/private"
|
|
|
|
const pb = new Pocketbase(POCKETBASE_URL || "http://localhost:8090");
|
|
|
|
export async function getPublicPortraits() {
|
|
return (await pb.collection("invites").getList(1, 100, {
|
|
filter: pb.filter(`portrait_public = true`)
|
|
})).items
|
|
}
|
|
|
|
export function createPerson({ name, confidence, portrait, portrait_public, noble_name, hair_color, hair_type, hair_length, skin_color }: { name: string, portrait: string, portrait_public: boolean, hair_type: string, hair_length: string, hair_color: string, confidence: number, noble_name: string, skin_color: string }) {
|
|
return pb.collection("invites").create({
|
|
name,
|
|
confidence,
|
|
portrait,
|
|
portrait_public,
|
|
noble_name,
|
|
hair_type,
|
|
hair_length,
|
|
hair_color,
|
|
skin_color
|
|
})
|
|
}
|