From 78fafcfc3550cf331d4d5aecffc12374dcd8219e Mon Sep 17 00:00:00 2001 From: Erika Date: Wed, 28 Feb 2024 14:49:54 +0200 Subject: [PATCH] fix: backend data changes --- src/routes/Blocks/Inputs.tsx | 4 ++-- src/routes/Blocks/Kernels.tsx | 4 ++-- src/routes/Blocks/Outputs.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/routes/Blocks/Inputs.tsx b/src/routes/Blocks/Inputs.tsx index 5e3c833..b4c9d82 100644 --- a/src/routes/Blocks/Inputs.tsx +++ b/src/routes/Blocks/Inputs.tsx @@ -41,11 +41,11 @@ function Inputs({ blockHeight }: { blockHeight: string }) { }; const itemsPerPage = 5; - const totalItems = data?.block.body.inputs.length || 0; + const totalItems = data?.body.inputs.length || 0; const totalPages = Math.ceil(totalItems / itemsPerPage); const startIndex = (page - 1) * itemsPerPage; const endIndex = startIndex + itemsPerPage; - const displayedItems = data?.block.body.inputs.slice(startIndex, endIndex); + const displayedItems = data?.body.inputs.slice(startIndex, endIndex); const renderItems = displayedItems?.map((content: any, index: number) => { const adjustedIndex = startIndex + index; diff --git a/src/routes/Blocks/Kernels.tsx b/src/routes/Blocks/Kernels.tsx index d2881c7..5010274 100644 --- a/src/routes/Blocks/Kernels.tsx +++ b/src/routes/Blocks/Kernels.tsx @@ -41,11 +41,11 @@ function Kernels({ blockHeight }: { blockHeight: string }) { }; const itemsPerPage = 5; - const totalItems = data?.block.body.kernels.length || 0; + const totalItems = data?.body.kernels.length || 0; const totalPages = Math.ceil(totalItems / itemsPerPage); const startIndex = (page - 1) * itemsPerPage; const endIndex = startIndex + itemsPerPage; - const displayedItems = data?.block.body.kernels.slice(startIndex, endIndex); + const displayedItems = data?.body.kernels.slice(startIndex, endIndex); const renderItems = displayedItems?.map((content: any, index: number) => { const adjustedIndex = startIndex + index; diff --git a/src/routes/Blocks/Outputs.tsx b/src/routes/Blocks/Outputs.tsx index f0757e8..a289464 100644 --- a/src/routes/Blocks/Outputs.tsx +++ b/src/routes/Blocks/Outputs.tsx @@ -41,11 +41,11 @@ function Outputs({ blockHeight }: { blockHeight: string }) { }; const itemsPerPage = 5; - const totalItems = data?.block.body.outputs.length || 0; + const totalItems = data?.body.outputs.length || 0; const totalPages = Math.ceil(totalItems / itemsPerPage); const startIndex = (page - 1) * itemsPerPage; const endIndex = startIndex + itemsPerPage; - const displayedItems = data?.block.body.outputs.slice(startIndex, endIndex); + const displayedItems = data?.body.outputs.slice(startIndex, endIndex); const renderItems = displayedItems?.map((content: any, index: number) => { const adjustedIndex = startIndex + index;