47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
const express = require('express')
|
|
const transactionController = require('./transactionController')
|
|
// const perm = require('../../middlewares/permissionMiddleware')
|
|
const loginCheck = require('../../middlewares/loginCheck')
|
|
|
|
const router = new express.Router()
|
|
|
|
router.use(loginCheck.loginProtect)
|
|
|
|
router.get(
|
|
'/admin/self',
|
|
// perm.requires('getallbelongings'),
|
|
transactionController.getUserTransaction
|
|
)
|
|
|
|
router.post(
|
|
'/admin/create',
|
|
// perm.requires('getallbelongings'),
|
|
transactionController.createTransaction
|
|
)
|
|
|
|
router.get(
|
|
'/admin/get-stock-by-belonging/:belongingId',
|
|
// perm.requires('getallbelongings'),
|
|
transactionController.getBelongingInventory
|
|
)
|
|
|
|
router.get(
|
|
'/admin/get-all-by-belonging/:belongingId',
|
|
// perm.requires('getallbelongings'),
|
|
transactionController.getTransactionByBelongingId
|
|
)
|
|
|
|
router.patch(
|
|
'/admin/update/:transactionId',
|
|
// perm.requires('getallbelongings'),
|
|
transactionController.updateTransaction
|
|
)
|
|
|
|
router.delete(
|
|
'/admin/delete/:transactionId',
|
|
// perm.requires('getallbelongings'),
|
|
transactionController.deleteTransaction
|
|
)
|
|
|
|
module.exports = router
|