Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gdd-sigma-poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume WANG
gdd-sigma-poc
Commits
0b21b6f9
Commit
0b21b6f9
authored
7 years ago
by
Quentin CHEVALIER
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.binets.fr:br/sigma-backend
parents
eb3d73a1
4dabba64
No related branches found
No related tags found
Loading
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.eslintignore
+0
-1
0 additions, 1 deletion
.eslintignore
db/migrations/20180301104213_insert_parent_column.js
+12
-0
12 additions, 0 deletions
db/migrations/20180301104213_insert_parent_column.js
src/graphql/schema.js
+3
-2
3 additions, 2 deletions
src/graphql/schema.js
with
15 additions
and
3 deletions
.eslintignore
+
0
−
1
View file @
0b21b6f9
db/migrations/
db/seeds/
build/
node_modules/
...
...
This diff is collapsed.
Click to expand it.
db/migrations/20180301104213_insert_parent_column.js
0 → 100644
+
12
−
0
View file @
0b21b6f9
exports
.
up
=
function
(
knex
,
Promise
)
{
return
knex
.
schema
.
table
(
'
groups
'
,
function
(
t
)
{
t
.
integer
(
'
parent
'
);
});
};
exports
.
down
=
function
(
knex
,
Promise
)
{
return
knex
.
schema
.
table
(
'
groups
'
,
function
(
t
)
{
t
.
dropColumn
(
'
parent
'
);
});
};
This diff is collapsed.
Click to expand it.
src/graphql/schema.js
+
3
−
2
View file @
0b21b6f9
...
...
@@ -25,12 +25,14 @@ 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)*/
;
};
const
getGroupIfVisible
=
(
user
,
id
)
=>
{
return
getAllVisibleGroups
(
user
)
/*.where('id', id).then(function(table) {
console
.
log
(
"
getGroupIfVisible gets called
"
)
return
getAllVisibleGroups
(
user
).
where
(
'
id
'
,
id
)
/*.then(function(table) {
console.log(JSON.stringify(table,null,2))*/
;
};
...
...
@@ -40,7 +42,6 @@ const resolvers = {
return
getAllVisibleGroups
(
context
.
user
);
},
group
:
(
obj
,
args
,
context
)
=>
{
console
.
log
(
args
.
id
);
return
getGroupIfVisible
(
context
.
user
,
args
.
id
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment