-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔥 chore: update routes to be RESTful
- Loading branch information
1 parent
215ff72
commit 6ce843f
Showing
5 changed files
with
57 additions
and
188 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
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 |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { Router } from "express" | ||
import captainController from "../controllers/captain.controller.js"; | ||
import { Router } from 'express' | ||
import captainController from '../controllers/captain.controller.js' | ||
|
||
const captainRouter = Router() | ||
|
||
const captainRouter = Router(); | ||
captainRouter.get('/:id', captainController.getCaptain) | ||
captainRouter.get('/all', captainController.getAllCaptains) | ||
captainRouter.get('/unit/:unitCaptainId', captainController.getCaptainsInUnit) | ||
captainRouter.get( | ||
'/sector/:baseName/:suffixName', | ||
captainController.getCaptainsInSector | ||
) | ||
|
||
|
||
captainRouter.get('/:id', captainController.captainInfo) | ||
captainRouter.get('/allCaptains/info', captainController.allCaptainsInfo) | ||
captainRouter.get('/allCaptains/count', captainController.allCaptainsCount) | ||
captainRouter.get('/captainsInSector/info', captainController.captainsInSectorInfo) | ||
captainRouter.get('/captainsInSector/count', captainController.captainsInSectorCount) | ||
captainRouter.get('/allCaptainsInUnit/info/:id', captainController.allCaptainsInUnitInfo) | ||
captainRouter.get('/allCaptainsInUnit/count/:id', captainController.allCaptainsInUnitCount) | ||
|
||
|
||
export default captainRouter | ||
export default captainRouter |
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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import { Router } from "express" | ||
import scoutController from "../controllers/scout.controller.js"; | ||
import { Router } from 'express' | ||
import scoutController from '../controllers/scout.controller.js' | ||
|
||
|
||
const scoutRouter = Router(); | ||
const scoutRouter = Router() | ||
|
||
scoutRouter.post('/', scoutController.insertScout) | ||
scoutRouter.get('/:id', scoutController.certainScoutInfo) | ||
scoutRouter.put('/:id', scoutController.updateScout) | ||
scoutRouter.get('/allScouts/count', scoutController.allScoutsCount) | ||
scoutRouter.get('/allScouts/info', scoutController.allScoutsInfo) | ||
scoutRouter.get('/allScoutsInSector/count', scoutController.scoutsInSectorCount) | ||
scoutRouter.get('/allScoutsInSector/info', scoutController.scoutsInSectorInfo) | ||
scoutRouter.get('/allScoutsInUnit/count/:id', scoutController.allScoutsInUnitCount) | ||
scoutRouter.get('/allScoutsInUnit/info/:id', scoutController.allScoutsInUnitInfo) | ||
scoutRouter.get('/:id', scoutController.getScout) | ||
scoutRouter.put('/:id', scoutController.updateScout) // or patch | ||
scoutRouter.get('/all', scoutController.getAllScouts) | ||
scoutRouter.get('/unit/:unitCaptainId', scoutController.getScoutsInUnit) | ||
scoutRouter.get( | ||
'/sector/:baseName/:suffixName', | ||
scoutController.getScoutsInSector | ||
) | ||
|
||
export default scoutRouter | ||
export default scoutRouter |