From 3052b66fe3b75bd09953dcd808b37f38113302c4 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Wed, 3 Dec 2025 16:36:05 +0330 Subject: [PATCH] fix bug --- src/components/awards/award-not-complete.tsx | 4 ++-- src/components/home/status-box.tsx | 14 +++++++------- src/utility/reports.tsx | 10 +++++++++- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/awards/award-not-complete.tsx b/src/components/awards/award-not-complete.tsx index 98bb010..b96ef73 100644 --- a/src/components/awards/award-not-complete.tsx +++ b/src/components/awards/award-not-complete.tsx @@ -25,7 +25,7 @@ export const AwardNotComplete: FC = ({ award }) => { window.location.reload() }, onError: (err: any) => { - console.log(err) + toast.error(err?.response?.data?.msg) } }) } @@ -37,7 +37,7 @@ export const AwardNotComplete: FC = ({ award }) => {

{award?.score}

- + {/* */}
diff --git a/src/components/home/status-box.tsx b/src/components/home/status-box.tsx index faad5c1..a9dd2f2 100644 --- a/src/components/home/status-box.tsx +++ b/src/components/home/status-box.tsx @@ -30,15 +30,15 @@ export const StatusBox = () => { // icon: , // value: data?.data?.user?.walletBalance // }, - { - name: "star", - title: "امتیاز شرکت در قرعه کشی", - icon: , - value: data?.data?.user?.score - }, + // { + // name: "star", + // title: "امتیاز شرکت در قرعه کشی", + // icon: , + // value: data?.data?.user?.score + // }, { name: "score-total", - title: "امتیاز", + title: "امتیاز شرکت در قرعه کشی", icon: , value: user?.score, secondaryValue: user?.totalScore diff --git a/src/utility/reports.tsx b/src/utility/reports.tsx index ac6e3d5..91eea3b 100644 --- a/src/utility/reports.tsx +++ b/src/utility/reports.tsx @@ -17,7 +17,15 @@ const columnConfigs: colConfig[] | [] = [ return deviceIdProfit ?? profit ?? ""; } }, - { accessor: "deviceId.score", header: "امتیاز" }, + { + accessor: "score", header: "امتیاز", + cellRenderer: (info) => { + const rowData = info.row.original; + const deviceIdScore = rowData?.deviceId?.score; + const score = rowData?.score; + return deviceIdScore ?? score ?? ""; + } + }, { accessor: "deviceType", header: "مدل دستگاه" }, { accessor: "IMEI", header: "شماره IMEI" }, { accessor: "installationDate", header: "تاریخ نصب", cellRenderer: (info) => info.getValue() &&

{formatDateToPersian(info.getValue())}

},