From df7f379860015e8d079bf9576192bbe3928d9b3b Mon Sep 17 00:00:00 2001 From: waynewyang Date: Fri, 19 Jan 2024 10:18:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20#91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #91 --- src/components/table/view/carReplica/index.tsx | 6 ++++-- .../carreplica/detail/{[id].tsx => index.tsx} | 13 +++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) rename src/pages/matching/carreplica/detail/{[id].tsx => index.tsx} (74%) diff --git a/src/components/table/view/carReplica/index.tsx b/src/components/table/view/carReplica/index.tsx index ce8cd99..ca322a6 100644 --- a/src/components/table/view/carReplica/index.tsx +++ b/src/components/table/view/carReplica/index.tsx @@ -35,8 +35,10 @@ export default ({ independent: { carId: { width: "20%", - render: (value) => ( - + render: (value, record) => ( + {value} ), diff --git a/src/pages/matching/carreplica/detail/[id].tsx b/src/pages/matching/carreplica/detail/index.tsx similarity index 74% rename from src/pages/matching/carreplica/detail/[id].tsx rename to src/pages/matching/carreplica/detail/index.tsx index 2ea7988..b2b5d26 100644 --- a/src/pages/matching/carreplica/detail/[id].tsx +++ b/src/pages/matching/carreplica/detail/index.tsx @@ -8,23 +8,28 @@ import { useSelector } from "react-redux" export default () => { const router = useRouter() - const { id } = router.query + const { carId, matchingId } = router.query const [carReplica, setCarReplica] = useState>() const network = useSelector( (state: { network: { network: string } }) => state.network.network ) useEffect(() => { - if (id) { + if (matchingId) { getCarReplica({ network, - queryFilter: { conditions: [{ carId: id }] }, + queryFilter: { + and: [ + { conditions: [{ carId }] }, + { conditions: [{ matchingId }] }, + ], + }, }).then((res) => { const result = res.data setCarReplica(result![0]) }) } - }, [id]) + }, [matchingId]) return <>{carReplica && } }