fix(api): 🐛 Fix post editing not working with JSON content-type

This commit is contained in:
Jesse Wierzbinski 2024-05-12 19:25:56 -10:00
parent b83d76abf6
commit eb976250a4
No known key found for this signature in database

View file

@ -42,6 +42,7 @@ export const schemas = {
sensitive: z
.string()
.transform((v) => ["true", "1", "on"].includes(v.toLowerCase()))
.or(z.boolean())
.optional(),
language: z
.enum(ISO6391.getAllCodes() as [string, ...string[]])
@ -59,10 +60,12 @@ export const schemas = {
"poll[multiple]": z
.string()
.transform((v) => ["true", "1", "on"].includes(v.toLowerCase()))
.or(z.boolean())
.optional(),
"poll[hide_totals]": z
.string()
.transform((v) => ["true", "1", "on"].includes(v.toLowerCase()))
.or(z.boolean())
.optional(),
}),
};