From db742a081c27db91762b0f7e5e95d4e32e0d2c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=AD=D8=B3=DB=8C=D9=86=20=D9=85=D8=B9=D8=B5=D9=88=D9=85?= =?UTF-8?q?=DB=8C=20=D9=BE=D9=88=D8=B1?= Date: Mon, 20 Nov 2023 10:49:26 +0330 Subject: [PATCH] handle reqouest for users shift plan --- .../BottomSheetAddUserToPositionShiftPlan.jsx | 5 ++++- src/app/shifts/manage-shift/page.jsx | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx b/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx index ebb4489..20c3559 100644 --- a/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx +++ b/plugins/BottomSheet/BottomSheetAddUserToPositionShiftPlan.jsx @@ -82,7 +82,10 @@ const BottomSheetAddUserToPositionShiftPlan = ({ const handleBottomSheetAddUserToPositionShiftPlan = (e) => { if (e.type == "OPEN") { - CTX.GetUsers(); + if (!!usersData.length <= 0) { + // User data is not in state, send request to get user + CTX.GetUsers(); + } } else if (e.type == "CLOSE") { // clear(); // CTX.setGoToEditRole(false); diff --git a/src/app/shifts/manage-shift/page.jsx b/src/app/shifts/manage-shift/page.jsx index 5fd3483..a7fc9f8 100644 --- a/src/app/shifts/manage-shift/page.jsx +++ b/src/app/shifts/manage-shift/page.jsx @@ -284,7 +284,7 @@ const Calendar = () => { {shiftPlanSteps >= 3 && (
-
+

ویرایش برای{" "} @@ -303,8 +303,8 @@ const Calendar = () => {

{positionsData.map((e) => ( -
-
+
+

{e.name}

@@ -354,7 +354,7 @@ const Calendar = () => {
*/}
0 ? "" : "justify-center" }`} > @@ -362,7 +362,7 @@ const Calendar = () => { userAndPositionIds?.map((item) => ( <> {e.id == item.key && ( -
+
deleteSearchUser(e)}