fix(web): corrige double JSON.stringify em mutations de contato/cliente e deprecation do Divider
apiFetch já serializa o body internamente; passá-lo como JSON.stringify(data) causava double-encoding e 400 Bad Request no cadastro via browser. Substitui orientation por titlePlacement no Divider de Contatos (AntD 6.x). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -142,7 +142,7 @@ export function ClientContacts({ idCliente }: Props) {
|
|||||||
marginBottom: 12,
|
marginBottom: 12,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Divider orientation="left" style={{ margin: 0, flex: 1 }}>
|
<Divider titlePlacement="left" style={{ margin: 0, flex: 1 }}>
|
||||||
Contatos
|
Contatos
|
||||||
</Divider>
|
</Divider>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -69,8 +69,7 @@ export function useCreateContato(idCliente: number | undefined) {
|
|||||||
mutationFn: async (data) => {
|
mutationFn: async (data) => {
|
||||||
const res = await apiFetch(`/clients/${idCliente}/contacts`, {
|
const res = await apiFetch(`/clients/${idCliente}/contacts`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
body: data,
|
||||||
body: JSON.stringify(data),
|
|
||||||
});
|
});
|
||||||
return ContatoResultSchema.parse(res);
|
return ContatoResultSchema.parse(res);
|
||||||
},
|
},
|
||||||
@@ -86,8 +85,7 @@ export function useCreateClientNovo() {
|
|||||||
mutationFn: async (data) => {
|
mutationFn: async (data) => {
|
||||||
const res = await apiFetch('/clients/novo', {
|
const res = await apiFetch('/clients/novo', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
body: data,
|
||||||
body: JSON.stringify(data),
|
|
||||||
});
|
});
|
||||||
return ClientNovoResultSchema.parse(res);
|
return ClientNovoResultSchema.parse(res);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user