Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-faraday
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
xpub
xpub-faraday
Commits
e11aef06
Commit
e11aef06
authored
6 years ago
by
Alexandru Munteanu
Browse files
Options
Downloads
Patches
Plain Diff
feat(adminUsers): update user mutation
parent
87a04d63
No related branches found
No related tags found
3 merge requests
!222
Sprint #26
,
!217
Sprint #26
,
!200
Component user add user
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/components-faraday/src/components/Admin/withUsersGQL.js
+12
-14
12 additions, 14 deletions
...s/components-faraday/src/components/Admin/withUsersGQL.js
with
12 additions
and
14 deletions
packages/components-faraday/src/components/Admin/withUsersGQL.js
+
12
−
14
View file @
e11aef06
...
...
@@ -11,12 +11,8 @@ const userFragment = gql`
country
username
lastName
isActive
firstName
affiliation
isConfirmed
editorInChief
handlingEditor
}
`
...
...
@@ -47,6 +43,8 @@ const updateUserMutation = gql`
${
userFragment
}
`
const
parseFormValues
=
({
admin
,
...
input
})
=>
input
export
default
compose
(
graphql
(
getUsersQuery
),
graphql
(
addUserMutation
,
{
...
...
@@ -57,16 +55,16 @@ export default compose(
}),
withHandlers
({
addUser
:
({
addUser
})
=>
(
values
,
props
)
=>
{},
updateUser
:
({
updateUser
})
=>
(
formValues
,
other
)
=>
{
console
.
log
(
'
aici vom face update
'
,
formValues
)
console
.
log
({
other
}
)
other
.
props
.
setError
(
'
iisus e mare
'
)
//
updateUser({
//
variables: {
//
id,
//
input,
//
},
//
}).then(hideModal)
.catch()
updateUser
:
({
updateUser
})
=>
(
{
__typename
,
id
,
...
formValues
},
{
props
:
{
hideModal
}
}
,
)
=>
{
updateUser
({
variables
:
{
id
,
input
:
parseFormValues
(
formValues
)
,
},
}).
then
(
hideModal
)
},
}),
withProps
(({
data
})
=>
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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