Skip to content
Snippets Groups Projects
Commit 170d15b7 authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

style(invitations): change error text

parent cc9efb9f
No related branches found
No related tags found
1 merge request!6Agree/Decline to work on a manuscript
...@@ -25,7 +25,7 @@ module.exports = models => async (req, res) => { ...@@ -25,7 +25,7 @@ module.exports = models => async (req, res) => {
if (invitation.hasAnswer) if (invitation.hasAnswer)
return res return res
.status(400) .status(400)
.json({ error: `${invitation.id} has already been answered` }) .json({ error: `Invitation has already been answered.` })
if (invitation.userId !== user.id) if (invitation.userId !== user.id)
return res.status(403).json({ return res.status(403).json({
error: `User ${user.email} is not allowed to modify invitation ${ error: `User ${user.email} is not allowed to modify invitation ${
......
...@@ -119,6 +119,6 @@ describe('Patch collections invitations route handler', () => { ...@@ -119,6 +119,6 @@ describe('Patch collections invitations route handler', () => {
await require(patchPath)(models)(req, res) await require(patchPath)(models)(req, res)
expect(res.statusCode).toBe(400) expect(res.statusCode).toBe(400)
const data = JSON.parse(res._getData()) const data = JSON.parse(res._getData())
expect(data.error).toEqual(`${inv.id} has already been answered`) expect(data.error).toEqual(`Invitation has already been answered.`)
}) })
}) })
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