mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
- write tests for userMiddleware - checks the functionality of nodes/locations middleware - refactor to not allow users to update to remove their name debatable whether we want that or not, but we do not allow users to create accounts with no name, so we should be consistent, before we were using neode to validate this, but we have are removing neode from production code, so we must validate ourselves - collate UpdateUser mutations to one
17 lines
572 B
JavaScript
17 lines
572 B
JavaScript
import createOrUpdateLocations from '../nodes/locations'
|
|
|
|
export default {
|
|
Mutation: {
|
|
SignupVerification: async (resolve, root, args, context, info) => {
|
|
const result = await resolve(root, args, context, info)
|
|
await createOrUpdateLocations(result.id, args.locationName, context.driver)
|
|
return result
|
|
},
|
|
UpdateUser: async (resolve, root, args, context, info) => {
|
|
const result = await resolve(root, args, context, info)
|
|
await createOrUpdateLocations(args.id, args.locationName, context.driver)
|
|
return result
|
|
},
|
|
},
|
|
}
|