Type mutation inputs with shared Zod schemas instead of Record<string, unknown>
Replaced loose Record<string, unknown> types on useCreateTicket, useUpdateTicket, useCreateUser, useUpdateUser, useUpdateWebhook, and useCreateSavedView with their corresponding shared schema types. Fixed three type errors this surfaced at call sites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,9 +38,10 @@ export default function NewTicketModal({ onClose }: NewTicketModalProps) {
|
||||
const onSubmit = async (data: CreateTicketInput) => {
|
||||
setError('');
|
||||
try {
|
||||
const payload: Record<string, unknown> = { ...data };
|
||||
if (!data.assigneeId) delete payload.assigneeId;
|
||||
const created = await createTicket.mutateAsync(payload);
|
||||
const { assigneeId, ...rest } = data;
|
||||
const created = await createTicket.mutateAsync(
|
||||
assigneeId ? { ...rest, assigneeId } : rest,
|
||||
);
|
||||
onClose();
|
||||
navigate(`/${created.displayId}`);
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user