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,
|
||||
}}
|
||||
>
|
||||
<Divider orientation="left" style={{ margin: 0, flex: 1 }}>
|
||||
<Divider titlePlacement="left" style={{ margin: 0, flex: 1 }}>
|
||||
Contatos
|
||||
</Divider>
|
||||
<Button
|
||||
|
||||
@@ -69,8 +69,7 @@ export function useCreateContato(idCliente: number | undefined) {
|
||||
mutationFn: async (data) => {
|
||||
const res = await apiFetch(`/clients/${idCliente}/contacts`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data),
|
||||
body: data,
|
||||
});
|
||||
return ContatoResultSchema.parse(res);
|
||||
},
|
||||
@@ -86,8 +85,7 @@ export function useCreateClientNovo() {
|
||||
mutationFn: async (data) => {
|
||||
const res = await apiFetch('/clients/novo', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data),
|
||||
body: data,
|
||||
});
|
||||
return ClientNovoResultSchema.parse(res);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user