add: error_code api
This commit is contained in:
19
routes/error_code.route.js
Normal file
19
routes/error_code.route.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const express = require('express');
|
||||
const ErrorCodeController = require('../controllers/error_code.controller');
|
||||
const verifyToken = require('../middleware/verifyToken');
|
||||
const verifyAccess = require('../middleware/verifyAccess');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.route('/brand/:brandId')
|
||||
.get(verifyToken.verifyAccessToken, ErrorCodeController.getByBrandId)
|
||||
.post(verifyToken.verifyAccessToken, verifyAccess(), ErrorCodeController.create);
|
||||
|
||||
router.route('/brand/:brandId/:errorCode')
|
||||
.put(verifyToken.verifyAccessToken, verifyAccess(), ErrorCodeController.update)
|
||||
.delete(verifyToken.verifyAccessToken, verifyAccess(), ErrorCodeController.delete);
|
||||
|
||||
router.route('/:id')
|
||||
.get(verifyToken.verifyAccessToken, ErrorCodeController.getById);
|
||||
|
||||
module.exports = router;
|
||||
@@ -18,6 +18,7 @@ const notificationError = require("./notification_error.route")
|
||||
const notificationErrorSparepart = require("./notification_error_sparepart.route")
|
||||
const sparepart = require("./sparepart.route")
|
||||
const notificationErrorLog = require("./notification_error_log.route")
|
||||
const errorCode = require("./error_code.route")
|
||||
|
||||
router.use("/auth", auth);
|
||||
router.use("/user", users);
|
||||
@@ -38,5 +39,6 @@ router.use("/notification", notificationError)
|
||||
router.use("/notification-sparepart", notificationErrorSparepart)
|
||||
router.use("/sparepart", sparepart)
|
||||
router.use("/notification-log", notificationErrorLog)
|
||||
router.use("/error-code", errorCode)
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user