Skip to content

Commit

Permalink
Merge pull request #600 from open-formulieren/issue/593-routers
Browse files Browse the repository at this point in the history
Refactor routes for `ManageAppointment`
  • Loading branch information
sergei-maertens authored Nov 23, 2023
2 parents 80ad3c0 + 9deac8a commit 8117bac
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 29 deletions.
9 changes: 6 additions & 3 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import AppDebug from 'components/AppDebug';
import {Cosign} from 'components/CoSign';
import Form from 'components/Form';
import LanguageSelection from 'components/LanguageSelection';
import {CreateAppointment, appointmentRoutes} from 'components/appointments';
import ManageAppointment from 'components/appointments/ManageAppointment';
import {
CreateAppointment,
appointmentRoutes,
manageAppointmentRoutes,
} from 'components/appointments';
import useFormContext from 'hooks/useFormContext';
import useQuery from 'hooks/useQuery';
import useZodErrorMap from 'hooks/useZodErrorMap';
Expand All @@ -21,7 +24,7 @@ import AppDisplay from './AppDisplay';
export const routes = [
{
path: 'afspraak-annuleren/*',
element: <ManageAppointment />,
children: manageAppointmentRoutes,
},
{
path: 'afspraak-maken/*',
Expand Down
26 changes: 0 additions & 26 deletions src/components/appointments/ManageAppointment.js

This file was deleted.

1 change: 1 addition & 0 deletions src/components/appointments/ManageAppointment/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {routes} from './routes';
18 changes: 18 additions & 0 deletions src/components/appointments/ManageAppointment/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import ErrorBoundary from 'components/Errors/ErrorBoundary';

import {CancelAppointment, CancelAppointmentSuccess} from '../cancel';

export const routes = [
{
path: '',
element: (
<ErrorBoundary>
<CancelAppointment />
</ErrorBoundary>
),
},
{
path: 'succes',
element: <CancelAppointmentSuccess />,
},
];
1 change: 1 addition & 0 deletions src/components/appointments/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export {default as CreateAppointment, routes as appointmentRoutes} from './CreateAppointment';
export {routes as manageAppointmentRoutes} from './ManageAppointment';

0 comments on commit 8117bac

Please sign in to comment.