Added test and query call
This commit is contained in:
@@ -2,10 +2,15 @@
|
||||
//
|
||||
//Requiremenst for inserting data in DB
|
||||
const adduser= require('../helpfunctions/adduser');
|
||||
const addgroup= require('../helpfunctions/addgroup');
|
||||
|
||||
const handleAddUserToGroup = (req, res, db) => {
|
||||
//Parsing req body
|
||||
const { reqgroup, requser} =req.body;
|
||||
//Initializing an empty group if group does not exists.
|
||||
//Initialization needed for group clearing to mantain a group when all users are cleared
|
||||
addgroup.handleAddGroup(reqgroup, db);
|
||||
|
||||
//Checking if user-group combination existis in DB table groups
|
||||
//if yes returns error if no inserts in DB table
|
||||
db.transaction (trx => {
|
||||
|
||||
Reference in New Issue
Block a user