Skip to content
Snippets Groups Projects
Commit 98df6b1e authored by Anatole ROMON's avatar Anatole ROMON
Browse files

modifs sur la base de reolution

parent 4dabba64
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@
*/
import knex from '../../db/knex_router';
// import { listGroups, listMembers } from '../ldap/ldap_data';
import { listGroups, listMembers } from '../ldap/ldap_data';
import { makeExecutableSchema } from 'graphql-tools';
import { request } from 'https';
......@@ -25,13 +25,15 @@ const typeDefs = `
`;
const getAllVisibleGroups = (user) => {
console.log("getAllVisibleGroups gets called")
// let group_ids = listGroups(user.id);
return knex.select().from('groups')/*.whereIn('id', group_ids)*/;
var group_ids;
console.log(user.id);
listGroups(user.id).then(res => {
group_ids = res;
});
return knex.select().from('groups').whereIn('id', group_ids);
};
const getGroupIfVisible = (user, id) => {
console.log("getGroupIfVisible gets called")
return getAllVisibleGroups(user).where('id', id)/*.then(function(table) {
console.log(JSON.stringify(table,null,2))*/;
};
......
......@@ -37,7 +37,8 @@ server.use('/graphql', bodyParser.json(), cors(),
let uid;
try {
uid = req.session.id;
uid = "anatole.romon";
//uid = req.session.id;
} catch (err) {
uid = "1";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment