Verbesserungen im Prozess

This commit is contained in:
Moritz Utcke
2025-03-25 19:15:16 -03:00
parent 0117f94c07
commit 75ade8ebaa
45 changed files with 380 additions and 392 deletions

33
src/lib/server/db.ts Normal file
View File

@@ -0,0 +1,33 @@
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
}
})
}