From a12b677c4251274f009cfcf3fd198ed8980395fa Mon Sep 17 00:00:00 2001 From: eliseukadesh67 Date: Mon, 29 Jul 2024 22:34:04 -0300 Subject: [PATCH] fix: redirect --- src/components/forms/ContractForm.js | 2 +- src/pages/ContractList.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/forms/ContractForm.js b/src/components/forms/ContractForm.js index 3dd2b539..164d364f 100644 --- a/src/components/forms/ContractForm.js +++ b/src/components/forms/ContractForm.js @@ -36,7 +36,7 @@ export default function ContractForm() { if (response.type === "success") { toast.success("Contrato criado com sucesso!"); setTimeout(() => { - const url = `/verContrato/${response.data.id}`; + const url = `/verContrato/${response.data.data.id}`; window.location = url }, 3000); } else { diff --git a/src/pages/ContractList.js b/src/pages/ContractList.js index ab1293d8..63f46fc7 100644 --- a/src/pages/ContractList.js +++ b/src/pages/ContractList.js @@ -18,7 +18,6 @@ export default function ContractList() { const fetchContracts = async () => { try { const response = await getContract(); - console.log(response.data.data); if (response.type === "success") { setContracts(response.data.data); } else {