Skip to content
Snippets Groups Projects
Commit 87a04d63 authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

Merge branch 'component-user-addUser' of...

Merge branch 'component-user-addUser' of gitlab.coko.foundation:xpub/xpub-faraday into component-user-addUser
parents c2aac4c5 6d7fbb1b
No related branches found
No related tags found
3 merge requests!222Sprint #26,!217Sprint #26,!200Component user add user
const Chance = require('chance')
const { omit } = require('lodash')
const chance = new Chance()
const resolvers = {
Mutation: {
async addUserWithConfirmationEmail(_, { input }, ctx) {
console.log('ROLE:', input.role)
input.notifications = {
email: {
system: true,
user: true,
},
const roles = {
admin: false,
editorInChief: false,
handlingEditor: false,
}
roles[input.role] = true
input.accessTokens = {
confirmation: chance.hash(),
unsubscribe: chance.hash(),
input = {
...omit(input, ['role']),
...roles,
isActive: true,
isConfirmed: false,
notifications: {
email: {
system: true,
user: true,
},
},
accessTokens: {
confirmation: chance.hash(),
unsubscribe: chance.hash(),
},
}
try {
const user = await ctx.connectors.User.create(input, ctx)
console.log(user)
return user
} catch (e) {
console.log(e)
return e
}
},
},
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment