-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add CRUD routes and controllers for jobs
- Loading branch information
Showing
2 changed files
with
113 additions
and
7 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 |
---|---|---|
@@ -1,9 +1,32 @@ | ||
import express from 'express' | ||
import { get_jobs, post_job } from '../controllers/job_controller' | ||
import { | ||
delete_job, | ||
get_job, | ||
get_jobs, | ||
post_job, | ||
update_job, | ||
} from '../controllers/job_controller' | ||
|
||
const router = express.Router() | ||
|
||
//* @desc Get all jobs | ||
//? @access Public | ||
router.get('/', get_jobs) | ||
|
||
//* @desc Get job | ||
//? @access Public | ||
router.get('/:id', get_job) | ||
|
||
//* @desc Post job | ||
//! @access Private | ||
router.post('/job', post_job) | ||
|
||
//* @desc Delete job | ||
//! @access Private | ||
router.delete('/:id', delete_job) | ||
|
||
//* @desc Update job | ||
//! @access Private | ||
router.patch('/:id', update_job) | ||
|
||
export default router |