mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-28 14:18:04 -05:00
Fix can't submit build without description
This commit is contained in:
@@ -77,7 +77,7 @@ function resolveDefaultValues(
|
||||
buildToEdit?.shoesGearSplId === -1 ? null : buildToEdit?.shoesGearSplId,
|
||||
abilities,
|
||||
title: buildToEdit?.title,
|
||||
description: buildToEdit?.description,
|
||||
description: buildToEdit?.description ?? null,
|
||||
modes: buildToEdit?.modes ?? [],
|
||||
private: Boolean(buildToEdit?.private),
|
||||
};
|
||||
|
||||
@@ -389,8 +389,9 @@ function buildInitialValues<T extends z.ZodRawShape>(
|
||||
| FormField
|
||||
| undefined;
|
||||
|
||||
if (defaultValues && key in defaultValues) {
|
||||
result[key] = defaultValues[key as keyof typeof defaultValues];
|
||||
const defaultValue = defaultValues?.[key as keyof typeof defaultValues];
|
||||
if (defaultValue !== undefined) {
|
||||
result[key] = defaultValue;
|
||||
} else if (formField) {
|
||||
result[key] = formField.initialValue;
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ export const safeNullableStringSchema = ({
|
||||
max: number;
|
||||
}) =>
|
||||
z.preprocess(
|
||||
actuallyNonEmptyStringOrNull,
|
||||
processMany(undefinedToNull, actuallyNonEmptyStringOrNull),
|
||||
z
|
||||
.string()
|
||||
.min(min ?? 0)
|
||||
|
||||
Reference in New Issue
Block a user