Files
online-energieausweis/src/lib/server/db.ts
2025-03-25 19:15:16 -03:00

33 lines
706 B
TypeScript

import { Aufnahme, Bild, Objekt, prisma, VerbrauchsausweisWohnen } from "./prisma.js";
export async function getVerbrauchsausweisWohnen(id: string): Promise<VerbrauchsausweisWohnen | null> {
return await prisma.verbrauchsausweisWohnen.findUnique({
where: {
id
}
})
}
export async function getAufnahme(id: string): Promise<Aufnahme | null> {
return await prisma.aufnahme.findUnique({
where: {
id
}
})
}
export async function getObjekt(id: string): Promise<Objekt | null> {
return await prisma.objekt.findUnique({
where: {
id
}
})
}
export async function getBilder(aufnahme_id: string): Promise<Bild[]> {
return await prisma.bild.findMany({
where: {
aufnahme_id
}
})
}