@@ -375,7 +352,7 @@ const ClinicsList = () => {
setType(newValue);
};
- const getData = async (filters) => {
+ const getData = async (filters, unregistered = true) => {
let params = {
...filters,
type,
@@ -385,7 +362,9 @@ const ClinicsList = () => {
setTotalInactive(resp?.data?.data?.data?.totalRejectedClinics);
return {
data: resp?.data?.data?.data?.clinics,
- rowCount: resp?.data?.data?.total,
+ rowCount: unregistered
+ ? resp?.data?.data?.data?.totalRejectedClinics
+ : resp?.data?.data?.data?.totalRegisteredClinics,
};
};
@@ -420,19 +399,20 @@ const ClinicsList = () => {
const handleFreezeClinic = async () => {
try {
// Determine if we're freezing or unfreezing based on current status
- const isCurrentlyFrozen = clinicToFreeze.status === CLINIC_STATUS.INACTIVE;
+ const isCurrentlyFrozen =
+ clinicToFreeze.status === CLINIC_STATUS.INACTIVE;
const newStatus = isCurrentlyFrozen ? "active" : CLINIC_STATUS.INACTIVE;
-
+
const payload = {
clinic_id: clinicToFreeze.id,
status: newStatus,
};
const resp = await updateClinicStatus(payload);
-
+
// Show appropriate success message
- const successMessage = isCurrentlyFrozen
- ? "Clinic unfrozen successfully"
+ const successMessage = isCurrentlyFrozen
+ ? "Clinic unfrozen successfully"
: "Clinic frozen successfully";
pushNotification(successMessage, NOTIFICATION.SUCCESS);
@@ -442,12 +422,16 @@ const ClinicsList = () => {
}
} catch (error) {
// Show appropriate error message
- const isCurrentlyFrozen = clinicToFreeze.status === CLINIC_STATUS.INACTIVE;
- const errorMessage = isCurrentlyFrozen
- ? "Failed to unfreeze clinic"
+ const isCurrentlyFrozen =
+ clinicToFreeze.status === CLINIC_STATUS.INACTIVE;
+ const errorMessage = isCurrentlyFrozen
+ ? "Failed to unfreeze clinic"
: "Failed to freeze clinic";
-
- console.error(`Error ${isCurrentlyFrozen ? 'unfreezing' : 'freezing'} clinic:`, error);
+
+ console.error(
+ `Error ${isCurrentlyFrozen ? "unfreezing" : "freezing"} clinic:`,
+ error
+ );
pushNotification(errorMessage, NOTIFICATION.ERROR);
}
@@ -456,7 +440,6 @@ const ClinicsList = () => {
setClinicToFreeze(null);
};
-
const breadcrumbs = [
{
label: "Dashboard",
@@ -517,7 +500,7 @@ const ClinicsList = () => {
getData(filters, true)} // true for unregistered
options={{
enableRowSelection: false,
showTopBar: false,
@@ -532,7 +515,7 @@ const ClinicsList = () => {
getData(filters, false)} // false for registered
options={{ enableRowSelection: true, showTopBar: false }}
showSearchBox={true}
ref={ref}
@@ -566,7 +549,7 @@ const ClinicsList = () => {
position: "relative",
}}
>
- {clinicToFreeze?.status === CLINIC_STATUS.INACTIVE
+ {clinicToFreeze?.status === CLINIC_STATUS.INACTIVE
? "Confirm Unfreeze Clinic"
: "Confirm Freeze Clinic"}
{
- {clinicToFreeze?.status === CLINIC_STATUS.INACTIVE
+ {clinicToFreeze?.status === CLINIC_STATUS.INACTIVE
? `Are you sure you want to unfreeze ${clinicToFreeze?.name}? This will restore the clinic's access to the system.`
- : `Are you sure you want to freeze ${clinicToFreeze?.name}? This will prevent the clinic from accessing the system until unfrozen.`
- }
+ : `Are you sure you want to freeze ${clinicToFreeze?.name}? This will prevent the clinic from accessing the system until unfrozen.`}
@@ -618,7 +600,9 @@ const ClinicsList = () => {
px: 3,
}}
>
- {clinicToFreeze?.status === CLINIC_STATUS.INACTIVE ? "Unfreeze" : "Freeze"}
+ {clinicToFreeze?.status === CLINIC_STATUS.INACTIVE
+ ? "Unfreeze"
+ : "Freeze"}
diff --git a/src/views/Dashboard/Tiles/Totals.jsx b/src/views/Dashboard/Tiles/Totals.jsx
index 58f646e..2a4e170 100644
--- a/src/views/Dashboard/Tiles/Totals.jsx
+++ b/src/views/Dashboard/Tiles/Totals.jsx
@@ -52,7 +52,7 @@ const Totals = ({ data, setData }) => {
@@ -61,7 +61,7 @@ const Totals = ({ data, setData }) => {
heading={`Inactive Doctors/Nurses`}
isLoading={isLoading}
viewAllClick={() => viewAllClick(true)}
- value={activeJobs}
+ value={totalMaxJobPostings}
// infoPopover={'Total no. of jobs which are in active state.'}
// color="#14d1ad"
/>
diff --git a/src/views/Login/loginReducer.js b/src/views/Login/loginReducer.js
index dc29ed3..8f75f20 100644
--- a/src/views/Login/loginReducer.js
+++ b/src/views/Login/loginReducer.js
@@ -13,10 +13,16 @@ const initialState = {};
const loginPending = (state) => ({
...state,
});
-const loginFulfilled = (state, payload) => ({
- ...state,
- token: payload?.payload?.data?.data,
-});
+
+const loginFulfilled = (state, payload) => {
+ // remove prev state
+ localStorage.removeItem('redux');
+ return {
+ ...state,
+ token: payload?.payload?.data?.data,
+ }
+}
+
const loginRejected = (state) => ({
...state,
});
diff --git a/src/views/MasterData/index.jsx b/src/views/MasterData/index.jsx
index 8ac8090..bf3e629 100644
--- a/src/views/MasterData/index.jsx
+++ b/src/views/MasterData/index.jsx
@@ -127,7 +127,6 @@ const MasterDataManagement = () => {
};
const resp = await getMasterData(params);
- console.log("API Response:", resp);
return {
data: resp?.data?.data?.data,
diff --git a/src/views/PaymentManagement/index.jsx b/src/views/PaymentManagement/index.jsx
index 50dcb50..12fb639 100644
--- a/src/views/PaymentManagement/index.jsx
+++ b/src/views/PaymentManagement/index.jsx
@@ -265,7 +265,7 @@ const PaymentManagement = () => {
showFilters: true,
}}
showAction={true}
- searchText="Payments"
+ searchText="Clinics"
showSearchBox={true}
actions={[
{
diff --git a/src/views/Signup/YourDetailsForm.jsx b/src/views/Signup/YourDetailsForm.jsx
index e62d2bb..5cc1599 100644
--- a/src/views/Signup/YourDetailsForm.jsx
+++ b/src/views/Signup/YourDetailsForm.jsx
@@ -1465,7 +1465,7 @@ function YourDetailsForm() {
{/* Clinic logo grid */}
-
+ {/*
-
+ */}
{/* ADD Business ADDRESS */}
diff --git a/src/views/User/index.jsx b/src/views/User/index.jsx
index 2af7d49..e3f5e83 100644
--- a/src/views/User/index.jsx
+++ b/src/views/User/index.jsx
@@ -203,7 +203,7 @@ function Users() {
},
{
size: 100,
- accessorFn: ({ role }) => role || NOT_AVAILABLE_TEXT,
+ accessorFn: ({ role }) => (role ? role.charAt(0).toUpperCase() + role.slice(1) : NOT_AVAILABLE_TEXT),
accessorKey: "role",
header: "User Type",
},
@@ -276,7 +276,7 @@ function Users() {
},
{
size: 100,
- accessorFn: ({ status }) => status || NOT_AVAILABLE_TEXT,
+ accessorFn: ({ status }) => (status ? status[0].toUpperCase() + status.slice(1) : NOT_AVAILABLE_TEXT),
accessorKey: "status",
header: "Status",
},
@@ -311,7 +311,7 @@ function Users() {
hideShowPerPage={false}
showSearchBox={true}
ref={ref}
- searchText={"user"}
+ searchText={"Doctor/Nurse(s)"}
getRowStyle={getRowStyle}
actions={[
{