This commit is contained in:
Moritz Utcke
2025-04-06 12:57:20 -04:00
parent 0b89320007
commit 7b0fdbf5f8
22 changed files with 140 additions and 118 deletions

View File

@@ -6,7 +6,7 @@ import { APIError, defineApiRoute } from "astro-typesafe-api/server";
export const GET = defineApiRoute({
input: z.object({
plz: z.string().min(4).max(5),
startdatum: z.coerce.date(),
startdatum: z.coerce.date().nullable(),
enddatum: z.coerce.date(),
genauigkeit: z.enum(["months", "years"]),
}),

View File

@@ -16,7 +16,7 @@ export const PATCH = defineApiRoute({
updated_at: true,
created_at: true
}).merge(z.object({
startdatum: z.coerce.date()
startdatum: z.coerce.date().nullable(),
})),
output: z.void(),
headers: {

View File

@@ -23,7 +23,7 @@ export const PUT = defineApiRoute({
updated_at: true,
created_at: true
}).merge(z.object({
startdatum: z.coerce.date()
startdatum: z.coerce.date().nullable()
})),
aufnahme_id: UUidWithPrefix
}),

View File

@@ -17,7 +17,7 @@ export const PATCH = defineApiRoute({
created_at: true,
updated_at: true
}).merge(z.object({
startdatum: z.coerce.date()
startdatum: z.coerce.date().nullable()
})),
output: z.void(),
headers: {

View File

@@ -19,7 +19,7 @@ export const PUT = defineApiRoute({
},
input: z.object({
ausweis: VerbrauchsausweisWohnenSchema.merge(z.object({
startdatum: z.coerce.date()
startdatum: z.coerce.date().nullable()
})).omit({
id: true,
benutzer_id: true,