From 831f21cb8ddcfc85d13df81ef88183d6dc4d8fe7 Mon Sep 17 00:00:00 2001 From: Nicolas Temciuc <nicotemciuc@gmail.com> Date: Thu, 28 Nov 2024 23:29:43 -0300 Subject: [PATCH] chore: show only active internal mechanism --- .../(home)/checker/pending-mechanisms/components/table.tsx | 2 +- back-office/src/components/fact-show/verify-fact.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/back-office/src/app/(home)/checker/pending-mechanisms/components/table.tsx b/back-office/src/app/(home)/checker/pending-mechanisms/components/table.tsx index 95bc8d5..7065772 100644 --- a/back-office/src/app/(home)/checker/pending-mechanisms/components/table.tsx +++ b/back-office/src/app/(home)/checker/pending-mechanisms/components/table.tsx @@ -45,7 +45,7 @@ const MechanismsTable = () => { <div key="mechanisms" className="flex flex-col gap-4"> {mechanisms?.length > 0 ? ( mechanisms.map((mechanism) => ( - <Link href={`/checker/facts/${mechanism.factId}`} key={mechanism.internalMechanismId}> + <Link href={`/checker/facts/${mechanism.factId}`} key={mechanism.internalMechanismId + mechanism.factId}> <div className="flex justify-between my-3 items-center gap-2 border border-gray-300 p-4 border rounded-lg"> <div className="flex flex-col gap-1"> <span className="font-bold">Mecanismo: {mechanism.name}</span> diff --git a/back-office/src/components/fact-show/verify-fact.tsx b/back-office/src/components/fact-show/verify-fact.tsx index b10b3ff..7db3d28 100644 --- a/back-office/src/components/fact-show/verify-fact.tsx +++ b/back-office/src/components/fact-show/verify-fact.tsx @@ -55,7 +55,9 @@ const VerifyFact = ({ id, fetchFact, nodeResults }) => { setIsLoading(true); - const mechanisms = await axiosInstance.get(`/internalMechanisms`); + let mechanisms = await axiosInstance.get(`/internalMechanisms`); + + mechanisms = mechanisms.filter((mechanism) => mechanism.active); const results = await axiosInstance.get(`/internalMechanisms/results`, { params: { factId, checkerId }, -- GitLab