From 682449e47f1af5cd554247d7f3e874445c9462de Mon Sep 17 00:00:00 2001 From: Ayush Gupta Date: Wed, 14 Feb 2024 20:00:03 +0530 Subject: [PATCH] fix(logs): show 0 cost if request is cached --- components/RequestTable.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/RequestTable.tsx b/components/RequestTable.tsx index 078405c..e898cfd 100644 --- a/components/RequestTable.tsx +++ b/components/RequestTable.tsx @@ -400,8 +400,11 @@ const columns: ColumnDef[] = [ accessorKey: "cost", header: "Cost", cell: ({ row }) => { - const value = row.getValue("cost") as number; - return
{currencyFormat(value, "USD", 4)}
; + const value = row.getValue('cost') as number; + const isRequestCached = row.getValue('cached') as boolean; + const costValue = isRequestCached ? 0 : value; + + return
{currencyFormat(costValue, 'USD', 4)}
; }, }, {