Fix not being able to send empty friend code

This commit is contained in:
Kalle 2022-03-22 00:08:57 +02:00
parent 430d32cb52
commit 74cff317f8

View File

@ -51,7 +51,10 @@ const settingsActionSchema = z.object({
safeJSONParse,
z.array(z.enum(weapons)).max(LFG_WEAPON_POOL_MAX_LENGTH)
),
friendCode: z.preprocess(falsyToNull, z.string().regex(friendCodeRegExp)),
friendCode: z.preprocess(
falsyToNull,
z.string().regex(friendCodeRegExp).nullable()
),
});
export const action: ActionFunction = async ({ request, context }) => {