forked from ookamiiixd/baileys-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
groupsRoute.js
26 lines (20 loc) · 882 Bytes
/
groupsRoute.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { Router } from 'express'
import { body, query } from 'express-validator'
import requestValidator from './../middlewares/requestValidator.js'
import sessionValidator from './../middlewares/sessionValidator.js'
import * as controller from './../controllers/groupsController.js'
import getMessages from './../controllers/getMessages.js'
const router = Router()
router.get('/', query('id').notEmpty(), requestValidator, sessionValidator, controller.getList)
router.get('/:jid', query('id').notEmpty(), requestValidator, sessionValidator, getMessages)
router.get('/meta/:jid', query('id').notEmpty(), requestValidator, sessionValidator, controller.getGroupMetaData)
router.post(
'/send',
query('id').notEmpty(),
body('receiver').notEmpty(),
body('message').notEmpty(),
requestValidator,
sessionValidator,
controller.send
)
export default router