This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add onboarding and map routes to specific router (#2341)
- Loading branch information
1 parent
c9a1972
commit c0c7d0f
Showing
3 changed files
with
41 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import express from 'express'; | ||
import * as mapController from '@controllers/mapController'; | ||
|
||
const router = express.Router(); | ||
|
||
router.get('/api/get-users-location', mapController.getUsersLocation); | ||
router.get('/map', mapController.getMap); | ||
|
||
export { router as mapRouter }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import express from 'express'; | ||
import { checkSchema } from 'express-validator'; | ||
|
||
import * as onboardingController from '@controllers/onboardingController'; | ||
import routes from './routes'; | ||
|
||
const router = express.Router(); | ||
|
||
router.get(routes.ONBOARDING, onboardingController.getForm); | ||
router.get(routes.ONBOARDING_API, onboardingController.getFormApi); | ||
|
||
router.post( | ||
routes.ONBOARDING_ACTION, | ||
checkSchema(onboardingController.postFormSchema), | ||
onboardingController.postOnboardingForm | ||
); | ||
router.post( | ||
routes.ONBOARDING_ACTION_API, | ||
checkSchema(onboardingController.postFormSchema), | ||
express.json({ type: '*/*' }), | ||
onboardingController.postOnboardingFormApi | ||
); | ||
router.get( | ||
'/onboardingSuccess/:prNumber', | ||
onboardingController.getConfirmation | ||
); | ||
|
||
export { router as onboardingRouter }; |