Verbesserungen im Prozess
This commit is contained in:
33
src/lib/server/db.ts
Normal file
33
src/lib/server/db.ts
Normal 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
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user