Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
c5ce6bcb
Unverified
Commit
c5ce6bcb
authored
Oct 14, 2019
by
Nicolas Giard
Committed by
GitHub
Oct 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: prevent duplicate group assignment (#1081)
parent
cffd32de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
group.js
server/graph/resolvers/group.js
+7
-0
No files found.
server/graph/resolvers/group.js
View file @
c5ce6bcb
...
...
@@ -34,6 +34,13 @@ module.exports = {
if
(
!
usr
)
{
throw
new
gql
.
GraphQLError
(
'Invalid User ID'
)
}
const
relExist
=
await
WIKI
.
models
.
knex
(
'userGroups'
).
where
({
userId
:
args
.
userId
,
groupId
:
args
.
groupId
}).
first
()
if
(
relExist
)
{
throw
new
gql
.
GraphQLError
(
'User is already assigned to group.'
)
}
await
grp
.
$relatedQuery
(
'users'
).
relate
(
usr
.
id
)
return
{
responseResult
:
graphHelper
.
generateSuccess
(
'User has been assigned to group.'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment