From a378254239f40536c471b6e0a6f6a1e350a1566f Mon Sep 17 00:00:00 2001 From: Hossein Rahmani Date: Mon, 29 Jan 2024 20:17:14 +0330 Subject: [PATCH] Bugs fixed --- .../(Admin)/AdminDashboard/layout.tsx | 2 +- .../ControllerDashboard/layout.tsx | 2 +- components/ComplainsDetails.tsx | 38 +- components/InspectorOperations.tsx | 4 +- components/NavbarPanel.tsx | 4 +- components/TabController.tsx | 5 + components/TableController.tsx | 8 +- components/Verify.tsx | 4 +- lib/utils.ts | 10 +- package-lock.json | 497 +++++++++++++++++- package.json | 3 +- utils/adminApi.ts | 2 +- utils/authenticateApi.ts | 14 +- utils/infoApi.ts | 2 +- utils/inspectorApi.ts | 2 +- 15 files changed, 552 insertions(+), 45 deletions(-) diff --git a/app/UserPanel/(Admin)/AdminDashboard/layout.tsx b/app/UserPanel/(Admin)/AdminDashboard/layout.tsx index 959f44d..afa85c3 100644 --- a/app/UserPanel/(Admin)/AdminDashboard/layout.tsx +++ b/app/UserPanel/(Admin)/AdminDashboard/layout.tsx @@ -8,7 +8,7 @@ export default function RootLayout({ children: React.ReactNode; }) { const cookieStore = cookies(); - const token = cookieStore.get("Sootzani_Token"); + const token = cookieStore.get("Sootzani_Admin_Token"); if (!token?.value) { return redirect("/"); } diff --git a/app/UserPanel/(Controller)/ControllerDashboard/layout.tsx b/app/UserPanel/(Controller)/ControllerDashboard/layout.tsx index a680a1c..bf0df32 100644 --- a/app/UserPanel/(Controller)/ControllerDashboard/layout.tsx +++ b/app/UserPanel/(Controller)/ControllerDashboard/layout.tsx @@ -7,7 +7,7 @@ export default function RootLayout({ children: React.ReactNode; }) { const cookieStore = cookies(); - const token = cookieStore.get("Sootzani_Token"); + const token = cookieStore.get("Sootzani_Admin_Token"); if (!token?.value) { return redirect("/"); } diff --git a/components/ComplainsDetails.tsx b/components/ComplainsDetails.tsx index ea1d18e..9ecf94e 100644 --- a/components/ComplainsDetails.tsx +++ b/components/ComplainsDetails.tsx @@ -259,7 +259,7 @@ export default function ComplainsDetails({

بازگشت

*/} -
+
{/* 1 */}
@@ -277,7 +277,7 @@ export default function ComplainsDetails({
{/* 2 */}
-
+
{data.user == null ? ( <>
@@ -316,6 +316,14 @@ export default function ComplainsDetails({ {convertFullTime(data.registeredAt)}

+

+ وضعیت:{" "} + + {data?.statusWithDescription + ? data.statusWithDescription.description + : "-"} + +

) : ( @@ -355,6 +363,14 @@ export default function ComplainsDetails({ {convertFullTime(data.registeredAt)} +

{" "} +

+ وضعیت:{" "} + + {data?.statusWithDescription + ? data.statusWithDescription.description + : "-"} +

@@ -393,6 +409,12 @@ export default function ComplainsDetails({ {data.trackingNumber ? data.trackingNumber : "-"} */}

+

+ {/* کد پیگیری:{" "} + + {data.trackingNumber ? data.trackingNumber : "-"} + */} +

)} @@ -412,21 +434,21 @@ export default function ComplainsDetails({ key={item.id} className="p-4 bg-white rounded-lg shadow-md " > -
+

- {item.sender == 0 ? "شهروند" : "بازرس"} + {item.operationWithDescription.description} توسط + {" "}{item.sender == 0 ? "شهروند" : "بازرس"}

- تاریخ : - - {convertDate(item.dateTime)} + + {convertFullTime(item.dateTime)}

- + {item.text ? item.text : "-"}
diff --git a/components/InspectorOperations.tsx b/components/InspectorOperations.tsx index e0eee2e..9002740 100644 --- a/components/InspectorOperations.tsx +++ b/components/InspectorOperations.tsx @@ -140,7 +140,7 @@ export default function InspectorOperations({ متن