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:
2026-06-24 17:40:30 +00:00
parent 34368e8006
commit 3413fa7003
2 changed files with 3 additions and 5 deletions

View File

@@ -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

View File

@@ -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);
}, },