mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Fix match-details
This commit is contained in:
parent
3b343e066e
commit
6310bbc823
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -4,4 +4,5 @@ node_modules
|
|||
/.cache
|
||||
/server/build
|
||||
/public/build
|
||||
/build
|
||||
/build
|
||||
backup.sql
|
||||
|
|
@ -37,7 +37,7 @@ export const detailedMapSchema = z.object({
|
|||
winners: teamInfoSchema,
|
||||
losers: teamInfoSchema,
|
||||
date: z.string().refine((val) => {
|
||||
const d = new Date(Number(val));
|
||||
const d = new Date(val);
|
||||
if (Number.isNaN(d.getTime())) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,9 @@ export async function parseRequestFormData<T extends z.ZodTypeAny>({
|
|||
// False alarm
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return schema.parse(
|
||||
useBody ? request.body : Object.fromEntries(await request.formData())
|
||||
useBody
|
||||
? await request.json()
|
||||
: Object.fromEntries(await request.formData())
|
||||
);
|
||||
} catch (e) {
|
||||
if (e instanceof z.ZodError) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
"migration:apply:prod": "npx prisma migrate deploy",
|
||||
"seed": "node --experimental-specifier-resolution=node --loader ts-node/esm -r tsconfig-paths/register prisma/seed",
|
||||
"seed:reset": "npx prisma migrate reset --force --skip-generate",
|
||||
"restore": "psql -d prod_copy -f backup.sql",
|
||||
"lint:ts": "eslint . --ext .ts,.tsx",
|
||||
"lint:styles": "stylelint \"app/styles/**/*.css\"",
|
||||
"lsf": "npm run lint:styles -- --fix",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user