BugFix: fixed translation formating

This commit is contained in:
2024-02-17 09:41:35 +01:00
parent 716fda63f1
commit fcd94408fe
8 changed files with 17 additions and 21 deletions

View File

@@ -25,7 +25,7 @@ export type State = {
*/
const FormSchema = (t:IntlTemplateFn) => z.object({
_id: z.string(),
locationName: z.coerce.string().min(1, t("location-name-required")),
locationName: z.coerce.string().min(1, t("validation.location-name-required")),
locationNotes: z.string(),
})
// dont include the _id field in the response
@@ -42,7 +42,7 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
noStore();
const t = await getTranslations("location-edit-form.validation");
const t = await getTranslations("location-edit-form");
const validatedFields = FormSchema(t).safeParse({
locationName: formData.get('locationName'),