mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
fix: wrap all async controller with error handler
* add validations to newCommand
This commit is contained in:
1 parent
1af85651b8
commit
c2dac8d385
13 files changed
+120
-120
No files matched your search
@@ -1,9 +1,10 @@
|
||||
import { Router } from 'express'
|
||||
import * as commandController from '../controllers/commandController.js'
|
||||
import { newCommandValidator } from '../validators/commandValidator.js'
|
||||
|
||||
const router = Router()
|
||||
|
||||
router.post('/', commandController.newCommand)
|
||||
router.post('/', newCommandValidator, commandController.newCommand)
|
||||
router.post('/completed', commandController.completedCommand)
|
||||
|
||||
export default router
|
||||
Reference in new issue
Block a user