refactor: remove z.config(z.locales.it()) from multiple form components and update chat import paths

This commit is contained in:
Marco Pedone 2026-04-29 13:16:37 +02:00
parent 60e4b187bf
commit 984b1d7ae5
13 changed files with 3 additions and 28 deletions

View file

@ -55,9 +55,6 @@ export const FormBanlist = ({
...initialValues, ...initialValues,
}; };
} }
z.config(z.locales.it());
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });

View file

@ -74,8 +74,6 @@ export const FormBanners = ({
}; };
} }
z.config(z.locales.it());
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });

View file

@ -66,8 +66,6 @@ export const FormEditOrder = ({ prezziario, data, close }: FormProps) => {
}); });
type FormValues = z.infer<typeof schema>; type FormValues = z.infer<typeof schema>;
z.config(z.locales.it());
const form = useZodForm(schema, { const form = useZodForm(schema, {
defaultValues: { defaultValues: {
...data, ...data,

View file

@ -51,8 +51,6 @@ export const FormEtichette = ({
}; };
} }
z.config(z.locales.it());
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });

View file

@ -43,8 +43,6 @@ export const FormFlags = ({
}; };
} }
z.config(z.locales.it());
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });

View file

@ -27,8 +27,6 @@ export const MustChangePasswordForm = ({
type FormValues = z.infer<typeof schema>; type FormValues = z.infer<typeof schema>;
z.config(z.locales.it());
const form = useZodForm(schema, { const form = useZodForm(schema, {
defaultValues: { defaultValues: {
mustChangePassword, mustChangePassword,

View file

@ -70,7 +70,6 @@ const Schema = z
}); });
type FormValues = z.infer<typeof Schema>; type FormValues = z.infer<typeof Schema>;
export const FormAddCodaEmail = ({ submitMutation }: FormProps) => { export const FormAddCodaEmail = ({ submitMutation }: FormProps) => {
z.config(z.locales.it());
const now = new Date(); const now = new Date();
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: { defaultValues: {

View file

@ -71,8 +71,6 @@ export const FormNewOrder = ({
}); });
type FormValues = z.infer<typeof schema>; type FormValues = z.infer<typeof schema>;
z.config(z.locales.it());
const form = useZodForm(schema, { const form = useZodForm(schema, {
defaultValues: { defaultValues: {
sconto: 0, sconto: 0,

View file

@ -94,8 +94,6 @@ export const FormPrezzo = ({
service_variant: null, service_variant: null,
}; };
z.config(z.locales.it());
const form = useZodForm(PrezzoSchema, { const form = useZodForm(PrezzoSchema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });

View file

@ -47,8 +47,6 @@ export const FormStringhe = ({
}; };
} }
z.config(z.locales.it());
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });

View file

@ -3,7 +3,7 @@ import type { GetServerSideProps } from "next";
import Head from "next/head"; import Head from "next/head";
import { useState } from "react"; import { useState } from "react";
import toast from "react-hot-toast"; import toast from "react-hot-toast";
import z from "zod"; import type z from "zod";
import { Confirm } from "~/components/confirm"; import { Confirm } from "~/components/confirm";
import { import {
Form, Form,
@ -311,8 +311,6 @@ const FormComuni = ({
defaultValues = initialValues; defaultValues = initialValues;
} }
z.config(z.locales.it());
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });
@ -626,8 +624,6 @@ const FormProvincie = ({
defaultValues = initialValues; defaultValues = initialValues;
} }
z.config(z.locales.it());
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });
@ -914,8 +910,6 @@ const FormNazioni = ({
defaultValues = initialValues; defaultValues = initialValues;
} }
z.config(z.locales.it());
const form = useZodForm(Schema, { const form = useZodForm(Schema, {
defaultValues: defaultValues, defaultValues: defaultValues,
}); });

View file

@ -28,7 +28,7 @@ import {
MessageUpdateEventSchema, MessageUpdateEventSchema,
SidebarUpdateSchema, SidebarUpdateSchema,
TypingDataSchema, TypingDataSchema,
} from "~/server/utils/zod_chat_types"; } from "~/server/utils/zod_utils";
import { getKeydbClient, getSubClient } from "~/utils/keydb"; import { getKeydbClient, getSubClient } from "~/utils/keydb";
import { withUserColorStr } from "~/utils/kysely-helper"; import { withUserColorStr } from "~/utils/kysely-helper";

View file

@ -3,6 +3,7 @@ import { chatsChatid } from "~/schemas/public/Chats";
import { MessagesSchema, messagesMessageid } from "~/schemas/public/Messages"; import { MessagesSchema, messagesMessageid } from "~/schemas/public/Messages";
import { usersId } from "~/schemas/public/Users"; import { usersId } from "~/schemas/public/Users";
z.config(z.locales.it());
export const MessageDataSchema = MessagesSchema.omit({ export const MessageDataSchema = MessagesSchema.omit({
time: true, time: true,
}).extend({ }).extend({