1
0
Fork 0
fahrPool/web/lib/orte-fahrzeuge/queries.ts

19 lines
635 B
TypeScript

import { createClient } from "@/lib/supabase/server";
import type { Ort, Fahrzeug } from "@/lib/auftraege/queries";
export async function loadOrt(id: string): Promise<Ort | null> {
const supabase = await createClient();
const { data } = await supabase.from("orte").select("id, adresse, ansprechpartner").eq("id", id).single();
return data ?? null;
}
export async function loadFahrzeug(id: string): Promise<Fahrzeug | null> {
const supabase = await createClient();
const { data } = await supabase
.from("fahrzeuge")
.select("id, kennzeichen, marke, modell")
.eq("id", id)
.single();
return data ?? null;
}