Added test and query call

This commit is contained in:
Naida Vatric
2019-11-01 01:16:23 +01:00
parent 03a7086162
commit 0ed5fb89c3
7 changed files with 84 additions and 68 deletions

View File

@@ -4,8 +4,10 @@ const handleClearGroup = (req, res, db) => {
//Parsing req body
const { reqgroup} =req.body;
//Checking for groupname in table groups and deleting users
db('groups')
db('groups')
.where('groupname', 'ilike', reqgroup)
//Group initialization is maintained
.andWhereNot('username', '')
.del()
.then (count => {
if (count!==0) {