Worked ban frontend and api.
This commit is contained in:
parent
5c936462a6
commit
c848994c1d
18 changed files with 513 additions and 41 deletions
|
|
@ -15,7 +15,7 @@ You should have received a copy of the GNU Affero General Public License
|
|||
along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
||||
|
||||
//npm imports
|
||||
const { checkExact } = require('express-validator');
|
||||
const { body, checkExact} = require('express-validator');
|
||||
const { Router } = require('express');
|
||||
|
||||
|
||||
|
|
@ -42,6 +42,8 @@ router.get('/permissions', permissionsController.get);
|
|||
router.post('/permissions', checkExact([permissionsValidator.permissionsMap(), channelPermissionValidator.channelPermissionsMap()]), permissionsController.post);
|
||||
router.post('/changeRank', accountValidator.user(), accountValidator.rank(), changeRankController.post);
|
||||
router.get('/ban', banController.get);
|
||||
router.post('/ban', accountValidator.user(), banController.post);
|
||||
//Sometimes they're so simple you don't need to put your validators in their own special place :P
|
||||
router.post('/ban', accountValidator.user(), body("permanent").isBoolean(), body("expirationDays").isInt(), banController.post);
|
||||
router.delete('/ban', accountValidator.user(), banController.delete);
|
||||
|
||||
module.exports = router;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue