Skip to content

best way to save what you love

api/processing: slightly reformat code related to zod

wukkoe727e3a95ba5
diff --git a/api/src/processing/request.js b/api/src/processing/request.js
index 4cd4d478..93de2fa0 100644
--- a/api/src/processing/request.js
+++ b/api/src/processing/request.js
@@ -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) {
diff --git a/api/src/processing/schema.js b/api/src/processing/schema.js
index 5b8a93f0..3203e3e8 100644
--- a/api/src/processing/schema.js
+++ b/api/src/processing/schema.js
@@ -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)