Skip to content
Snippets Groups Projects
Commit a02f8030 authored by Sebastian's avatar Sebastian
Browse files

feat(component-user-manager): fix user patch

parent 0d4568e0
No related branches found
No related tags found
1 merge request!5Refactor component invite
......@@ -34,9 +34,10 @@ module.exports = models => async (req, res) => {
error: 'Collection and user do not match',
})
}
matchingAuthor.firstName = firstName
matchingAuthor.lastName = lastName
matchingAuthor.affiliation = affiliation
user.firstName = firstName
user.lastName = lastName
user.affiliation = affiliation
await user.save()
matchingAuthor.isSubmitting = isSubmitting
matchingAuthor.isCorresponding = isCorresponding
collection = await collection.save()
......
......@@ -42,7 +42,8 @@ describe('Patch collections users route handler', () => {
)
expect(matchingAuthor.isSubmitting).toBe(body.isSubmitting)
expect(matchingAuthor.isCorresponding).toBe(body.isCorresponding)
expect(matchingAuthor.firstName).toBe(body.firstName)
expect(submittingAuthor.firstName).toBe(body.firstName)
expect(submittingAuthor.lastName).toBe(body.lastName)
})
it('should return an error when the params are missing', async () => {
delete body.isSubmitting
......
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