Complete v1 loop for bot-based integrations

This commit is contained in:
Tuan Dang
2022-12-08 23:22:44 -05:00
parent 46fe724012
commit 1757f0d690
33 changed files with 1085 additions and 638 deletions
+4 -5
View File
@@ -1,6 +1,6 @@
import express from 'express';
const router = express.Router();
import { body } from 'express-validator';
import { body, param } from 'express-validator';
import {
requireAuth,
requireBotAuth,
@@ -11,14 +11,13 @@ import { botController } from '../controllers';
import { ADMIN, MEMBER, COMPLETED, GRANTED } from '../variables';
router.get(
'/',
'/:workspaceId',
requireAuth,
requireWorkspaceAuth({
acceptedRoles: [ADMIN, MEMBER],
acceptedStatuses: [COMPLETED, GRANTED],
location: 'body'
acceptedStatuses: [COMPLETED, GRANTED]
}),
body('workspaceId').exists().trim().notEmpty(),
param('workspaceId').exists().trim().notEmpty(),
validateRequest,
botController.getBotByWorkspaceId
);