33 lines
706 B
TypeScript
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
|
|
}
|
|
})
|
|
} |