Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
volcareso committed Nov 28, 2021
1 parent 2bda4fe commit a417869
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pages/api/create/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ if (req.method !== 'POST') {
if(e.code == 'P2002'){
res.setHeader('Content-Type', 'application/json')
res.status(400).send({ message: "the url already exists! Choose a better name!" })
}
}else{
res.setHeader('Content-Type', 'application/json')
res.status(400).send({ message: e.code })
}
}
}else{
res.setHeader('Content-Type', 'application/json')
Expand Down

1 comment on commit a417869

@vercel
Copy link

@vercel vercel bot commented on a417869 Nov 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.