fix(invites): creation with custom expiration not working (#4677)

This commit is contained in:
Meier Lukas
2025-12-16 22:35:42 +01:00
committed by GitHub
parent 17fc7a043b
commit 423da9eeb8

View File

@@ -13,7 +13,7 @@ import { InviteCopyModal } from "./invite-copy-modal";
dayjs.extend(relativeTime); dayjs.extend(relativeTime);
interface FormType { interface FormType {
expirationDate: Date; expirationDate: string;
} }
export const InviteCreateModal = createModal<void>(({ actions }) => { export const InviteCreateModal = createModal<void>(({ actions }) => {
@@ -28,18 +28,23 @@ export const InviteCreateModal = createModal<void>(({ actions }) => {
const form = useForm<FormType>({ const form = useForm<FormType>({
initialValues: { initialValues: {
expirationDate: dayjs().add(4, "hours").toDate(), expirationDate: dayjs().add(4, "hours").toDate().toISOString(),
}, },
}); });
const handleSubmit = (values: FormType) => { const handleSubmit = (values: FormType) => {
mutate(values, { mutate(
onSuccess: (result) => { {
void utils.invite.getAll.invalidate(); expirationDate: new Date(values.expirationDate),
actions.closeModal();
openModal(result);
}, },
}); {
onSuccess: (result) => {
void utils.invite.getAll.invalidate();
actions.closeModal();
openModal(result);
},
},
);
}; };
return ( return (