api/processing: slightly reformat code related to zod
This commit is contained in:
parent
66d70ffc44
commit
e727e3a95b
2 changed files with 6 additions and 4 deletions
|
@ -72,7 +72,9 @@ export function createResponse(responseType, responseData) {
|
|||
}
|
||||
|
||||
export function normalizeRequest(request) {
|
||||
return apiSchema.safeParseAsync(request).catch(() => ({ success: false }));
|
||||
return apiSchema.safeParseAsync(request).catch(() => (
|
||||
{ success: false }
|
||||
));
|
||||
}
|
||||
|
||||
export function getIP(req) {
|
||||
|
|
|
@ -24,9 +24,9 @@ export const apiSchema = z.object({
|
|||
["h264", "av1", "vp9"]
|
||||
).default("h264"),
|
||||
|
||||
videoQuality: z.enum([
|
||||
"max", "4320", "2160", "1440", "1080", "720", "480", "360", "240", "144"
|
||||
]).default("720"),
|
||||
videoQuality: z.enum(
|
||||
["max", "4320", "2160", "1440", "1080", "720", "480", "360", "240", "144"]
|
||||
).default("720"),
|
||||
|
||||
youtubeDubLang: z.string()
|
||||
.length(2)
|
||||
|
|
Loading…
Reference in a new issue