feat: inplement auth for cases

This commit is contained in:
Takeshi Kimata
2024-06-03 22:51:26 +09:00
parent e4db79047a
commit fe8b82cb4b
14 changed files with 106 additions and 98 deletions

View File

@@ -13,8 +13,9 @@ module.exports = function (sequelize) {
Step.belongsToMany(Case, { through: 'caseSteps' });
Case.belongsToMany(Attachment, { through: 'caseAttachments' });
Attachment.belongsToMany(Case, { through: 'caseAttachments' });
const { verifySignedIn, verifyProjectVisible } = require('../../middleware/auth')(sequelize);
router.get('/:caseId', async (req, res) => {
router.get('/:caseId', verifySignedIn, verifyProjectVisible, async (req, res) => {
const caseId = req.params.caseId;
if (!caseId) {