Fix Breadcrumbs Links
This commit is contained in:
@@ -62,12 +62,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
const onSubmit = async (data: any) => {
|
||||
if (!isEdit) {
|
||||
await axios
|
||||
.post('/corporates/' + corporate_id + '/divisions', data)
|
||||
.post('/corporate/' + corporate_id + '/divisions', data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Division created successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/divisions', { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/divisions', { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
if (response.status === 422) {
|
||||
@@ -81,12 +81,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
});
|
||||
} else {
|
||||
await axios
|
||||
.put('/corporates/' + corporate_id + '/divisions/' + currentCorporatePlan?.id, data)
|
||||
.put('/corporate/' + corporate_id + '/divisions/' + currentCorporatePlan?.id, data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Division updated successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/divisions/', { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/divisions/', { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar('Update Failed : ' + response.data.message, { variant: 'error' });
|
||||
|
||||
@@ -35,11 +35,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Benefit',
|
||||
href: '/corporates/' + corporate_id + '/benefits',
|
||||
href: '/corporate/' + corporate_id + '/benefits',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -326,7 +326,7 @@ export default function PlanList() {
|
||||
</Button>
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
{/* <TableCell align="center">
|
||||
<Button
|
||||
variant="outlined"
|
||||
color="success"
|
||||
@@ -340,7 +340,7 @@ export default function PlanList() {
|
||||
>
|
||||
{openEdit ? 'Save' : 'Edit'}
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableCell> */}
|
||||
</TableRow>
|
||||
{/* COLLAPSIBLE ROW */}
|
||||
<TableRow>
|
||||
@@ -767,9 +767,9 @@ export default function PlanList() {
|
||||
<TableCell style={headStyle} align="center">
|
||||
Status
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="center">
|
||||
{/* <TableCell style={headStyle} align="center">
|
||||
Action
|
||||
</TableCell>
|
||||
</TableCell> */}
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
{dataTableIsLoading ? (
|
||||
|
||||
@@ -64,12 +64,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
const onSubmit = async (data: any) => {
|
||||
if (!isEdit) {
|
||||
await axios
|
||||
.post('/corporates/' + corporate_id + '/divisions', data)
|
||||
.post('/corporate/' + corporate_id + '/divisions', data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Division created successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/divisions', { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/divisions', { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
if (response.status === 422) {
|
||||
@@ -84,12 +84,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
});
|
||||
} else {
|
||||
await axios
|
||||
.put('/corporates/' + corporate_id + '/divisions/' + currentCorporatePlan?.id , data)
|
||||
.put('/corporate/' + corporate_id + '/divisions/' + currentCorporatePlan?.id , data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Division updated successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/divisions/' , { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/divisions/' , { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar('Update Failed : '+ response.data.message, { variant: 'error' });
|
||||
|
||||
@@ -33,11 +33,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Claim History',
|
||||
href: '/corporates/' + corporate_id + '/claim-histories',
|
||||
href: '/corporate/' + corporate_id + '/claim-histories',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -64,12 +64,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporateBenefit }: P
|
||||
const onSubmit = async (data: any) => {
|
||||
if (!isEdit) {
|
||||
await axios
|
||||
.post('/corporates/' + corporate_id + '/corporate-benefits', data)
|
||||
.post('/corporate/' + corporate_id + '/corporate-benefits', data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Corporate Plan created successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/corporate-benefits', { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/corporate-benefits', { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
if (response.status === 422) {
|
||||
@@ -84,12 +84,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporateBenefit }: P
|
||||
});
|
||||
} else {
|
||||
await axios
|
||||
.put('/corporates/' + corporate_id + '/corporate-benefits/' + currentCorporateBenefit?.id , data)
|
||||
.put('/corporate/' + corporate_id + '/corporate-benefits/' + currentCorporateBenefit?.id , data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Corporate Benefit updated successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/corporate-benefits/' , { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/corporate-benefits/' , { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar('Update Failed : '+ response.data.message, { variant: 'error' });
|
||||
|
||||
@@ -64,12 +64,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
const onSubmit = async (data: any) => {
|
||||
if (!isEdit) {
|
||||
await axios
|
||||
.post('/corporates/' + corporate_id + '/corporate-plans', data)
|
||||
.post('/corporate/' + corporate_id + '/corporate-plans', data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Corporate Plan created successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/corporate-plans', { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/corporate-plans', { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
if (response.status === 422) {
|
||||
@@ -83,12 +83,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
});
|
||||
} else {
|
||||
await axios
|
||||
.put('/corporates/' + corporate_id + '/corporate-plans/' + currentCorporatePlan?.id, data)
|
||||
.put('/corporate/' + corporate_id + '/corporate-plans/' + currentCorporatePlan?.id, data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Corporate Plan updated successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/corporate-plans/', { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/corporate-plans/', { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar('Update Failed : ' + response.data.message, { variant: 'error' });
|
||||
|
||||
@@ -32,11 +32,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Corporate Plan',
|
||||
href: '/corporates/' + corporate_id + '/corporate-plans',
|
||||
href: '/corporate/' + corporate_id + '/corporate-plans',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -36,11 +36,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Diagnosis Exclusion',
|
||||
href: '/corporates/' + corporate_id + '/diagnosis-exclusions',
|
||||
href: '/corporate/' + corporate_id + '/diagnosis-exclusions',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -64,12 +64,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
const onSubmit = async (data: any) => {
|
||||
if (!isEdit) {
|
||||
await axios
|
||||
.post('/corporates/' + corporate_id + '/divisions', data)
|
||||
.post('/corporate/' + corporate_id + '/divisions', data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Division created successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/divisions', { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/divisions', { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
if (response.status === 422) {
|
||||
@@ -84,12 +84,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
});
|
||||
} else {
|
||||
await axios
|
||||
.put('/corporates/' + corporate_id + '/divisions/' + currentCorporatePlan?.id , data)
|
||||
.put('/corporate/' + corporate_id + '/divisions/' + currentCorporatePlan?.id , data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Division updated successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/divisions/' , { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/divisions/' , { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar('Update Failed : '+ response.data.message, { variant: 'error' });
|
||||
|
||||
@@ -36,11 +36,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/'+corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Division',
|
||||
href: '/corporates/'+corporate_id+'/divisions',
|
||||
href: '/corporate/' + corporate_id + '/divisions',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -191,7 +191,7 @@ export default function PlanList() {
|
||||
const loadDataTableData = async (appliedFilter: any | null = null) => {
|
||||
setDataTableLoading(true);
|
||||
const filter = appliedFilter ? appliedFilter : Object.fromEntries([...searchParams.entries()]);
|
||||
const response = await axios.get('/corporates/' + corporate_id + '/divisions', {
|
||||
const response = await axios.get('/corporate/' + corporate_id + '/divisions', {
|
||||
params: filter,
|
||||
});
|
||||
// console.log(response.data);
|
||||
|
||||
@@ -34,11 +34,11 @@ export default function CorporateFormularium() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Formularium',
|
||||
href: '/corporates/' + corporate_id + '/formularium',
|
||||
href: '/corporate/' + corporate_id + '/formularium',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -64,12 +64,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
const onSubmit = async (data: any) => {
|
||||
if (!isEdit) {
|
||||
await axios
|
||||
.post('/corporates/' + corporate_id + '/divisions', data)
|
||||
.post('/corporate/' + corporate_id + '/divisions', data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Division created successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/divisions', { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/divisions', { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
if (response.status === 422) {
|
||||
@@ -84,12 +84,12 @@ export default function CorporatePlanForm({ isEdit, currentCorporatePlan }: Prop
|
||||
});
|
||||
} else {
|
||||
await axios
|
||||
.put('/corporates/' + corporate_id + '/divisions/' + currentCorporatePlan?.id , data)
|
||||
.put('/corporate/' + corporate_id + '/divisions/' + currentCorporatePlan?.id , data)
|
||||
.then((res) => {
|
||||
enqueueSnackbar('Division updated successfully', { variant: 'success' });
|
||||
})
|
||||
.then((res) => {
|
||||
navigate('/corporates/' + corporate_id + '/divisions/' , { replace: true });
|
||||
navigate('/corporate/' + corporate_id + '/divisions/' , { replace: true });
|
||||
})
|
||||
.catch(({ response }) => {
|
||||
enqueueSnackbar('Update Failed : '+ response.data.message, { variant: 'error' });
|
||||
|
||||
@@ -34,11 +34,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Hospitals',
|
||||
href: '/corporates/' + corporate_id + '/hospitals',
|
||||
href: '/corporate/' + corporate_id + '/hospitals',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -4,7 +4,7 @@ import HeaderBreadcrumbs from '../../../components/HeaderBreadcrumbs';
|
||||
import Page from '../../../components/Page';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import CorporateTabNavigations from '../CorporateTabNavigations';
|
||||
import DivisionsList from './List';
|
||||
import MemberList from './List';
|
||||
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
import { ConfiguredCorporateContext } from '@/contexts/ConfiguredCorporateContext';
|
||||
@@ -33,18 +33,18 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Member',
|
||||
href: '/corporates/' + corporate_id + '/members',
|
||||
href: '/corporate/' + corporate_id + '/members',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
<Card>
|
||||
<CorporateTabNavigations position={'members'} />
|
||||
<DivisionsList />
|
||||
<MemberList />
|
||||
</Card>
|
||||
</Page>
|
||||
);
|
||||
|
||||
@@ -540,9 +540,9 @@ export default function CorporatePlanList() {
|
||||
<TableCell style={headStyle} align="center">
|
||||
Status
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="center">
|
||||
{/* <TableCell style={headStyle} align="center">
|
||||
Action
|
||||
</TableCell>
|
||||
</TableCell> */}
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
{dataTableIsLoading ? (
|
||||
|
||||
@@ -32,11 +32,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Plan',
|
||||
href: '/corporates/' + corporate_id + '/plans',
|
||||
href: '/corporate/' + corporate_id + '/plans',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -309,11 +309,11 @@ export default function CorporatePlanList() {
|
||||
</Button>
|
||||
)}
|
||||
</TableCell>
|
||||
<TableCell align="center">
|
||||
{/* <TableCell align="center">
|
||||
<Button variant="outlined" color="success" size="small">
|
||||
Edit
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableCell> */}
|
||||
</TableRow>
|
||||
{/* COLLAPSIBLE ROW */}
|
||||
<TableRow>
|
||||
@@ -677,9 +677,9 @@ export default function CorporatePlanList() {
|
||||
<TableCell style={headStyle} align="center">
|
||||
Status
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} align="center">
|
||||
{/* <TableCell style={headStyle} align="center">
|
||||
Action
|
||||
</TableCell>
|
||||
</TableCell> */}
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
{dataTableIsLoading ? (
|
||||
|
||||
@@ -50,19 +50,27 @@ import Page from '../../../components/Page';
|
||||
import useSettings from '../../../hooks/useSettings';
|
||||
import CorporateTabNavigations from '../CorporateTabNavigations';
|
||||
import DivisionsList from './List';
|
||||
import { ChangeEvent, useEffect, useMemo, useState } from 'react';
|
||||
import { ChangeEvent, useContext, useEffect, useMemo, useState } from 'react';
|
||||
import axios from '../../../utils/axios';
|
||||
import { CorporateService } from '../../../@types/corporates';
|
||||
import { Corporate, CorporateService } from '../../../@types/corporates';
|
||||
import { InfoIcon } from '../../../theme/overrides/CustomIcons';
|
||||
import { includes, min, set } from 'lodash';
|
||||
import { array } from 'yup/lib/locale';
|
||||
import CancelIcon from '@mui/icons-material/Cancel';
|
||||
import { enqueueSnackbar, useSnackbar } from 'notistack';
|
||||
import { ConfiguredCorporateContext } from '@/contexts/ConfiguredCorporateContext';
|
||||
|
||||
export default function Divisions() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const { corporate_id, service_code } = useParams();
|
||||
const [corporate, setCorporate] = useState<Corporate | null>();
|
||||
|
||||
const configuredCorporateContext = useContext(ConfiguredCorporateContext);
|
||||
|
||||
useEffect(() => {
|
||||
setCorporate(configuredCorporateContext.currentCorporate);
|
||||
}, [configuredCorporateContext]);
|
||||
|
||||
const [service, setService] = useState<CorporateService>({
|
||||
configurations: {},
|
||||
@@ -80,7 +88,7 @@ export default function Divisions() {
|
||||
// console.log('specialities', specialities);
|
||||
|
||||
useEffect(() => {
|
||||
axios.get('/corporates/' + corporate_id + '/services/' + service_code).then((res) => {
|
||||
axios.get('/corporate/' + corporate_id + '/services/' + service_code).then((res) => {
|
||||
setService(res.data.service);
|
||||
setPlans(
|
||||
res.data.corporate.plans.map((item: any) => ({
|
||||
@@ -364,22 +372,21 @@ export default function Divisions() {
|
||||
<HeaderBreadcrumbs
|
||||
heading={'Create Benefit'}
|
||||
links={[
|
||||
{ name: 'Dashboard', href: '/dashboard' },
|
||||
{
|
||||
name: 'Corporates',
|
||||
href: '/corporates',
|
||||
},
|
||||
{
|
||||
name: 'Corporate Name',
|
||||
href: '/corporates/' + corporate_id,
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Services',
|
||||
href: '/corporates/' + corporate_id + '/services',
|
||||
href: '/corporate/' + corporate_id + '/services',
|
||||
},
|
||||
{
|
||||
name: service.name ?? '-',
|
||||
href: '/corporates/' + corporate_id + '/services/' + service_code,
|
||||
name: service_code ?? '-',
|
||||
href: '/corporate/' + corporate_id + '/services/' + service_code,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -34,11 +34,11 @@ export default function Divisions() {
|
||||
},
|
||||
{
|
||||
name: corporate?.name ?? '-',
|
||||
href: '/corporates/' + corporate_id,
|
||||
href: '/corporate/' + corporate_id,
|
||||
},
|
||||
{
|
||||
name: 'Services',
|
||||
href: '/corporates/' + corporate_id + '/services',
|
||||
href: '/corporate/' + corporate_id + '/services',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user