From 09dc56e803ab2005f2ff967691efacff3efc15c8 Mon Sep 17 00:00:00 2001 From: anatole <anatole.romon@polytechnique.edu> Date: Thu, 1 Mar 2018 18:26:43 +0100 Subject: [PATCH] fini le code pour creer un groupe --- src/graphql/schema.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/graphql/schema.js b/src/graphql/schema.js index d46a4c1..372ae4f 100644 --- a/src/graphql/schema.js +++ b/src/graphql/schema.js @@ -123,7 +123,16 @@ const createGroupIfLegal = (user, args) => { if(admin_list.indexOf(user.id) == -1) throw "illegal request : you must have admin rights over a group to create a subgroup of that group"; return(getAvailableGroupUID(args.uid).then(rasUID => { - + knex('groups').insert({ + uid : rasUID, + parentuid : args.parentuid, + createdAt : knex.fn.now(), + updatedAt : this.createdAt, + name : args.name, + website : args.website, + description : args.description, + school : args.school + }); })); }); }; -- GitLab