import { pb } from "$lib/constants"; import { Waypoint } from "$lib/models/waypoint"; import { writable, type Writable } from "svelte/store"; export const waypoint: Writable = writable(new Waypoint(0, 0)); export async function waypoints_create(bodyParams?: { [key: string]: any; } | FormData) { const model = await pb .collection("waypoints") .create(bodyParams); return model; } export async function waypoints_delete(id: string) { const success = await pb .collection("waypoints") .delete(id); return success; }