An empty or non-unique value sent in a POST request to an endpoint that implements a field that implements the unique property will return an error as expected, but increments the id value of the user table.
Nit pick, and I suspect it's possible this just might be how Postgres doest, but it seems potentially unnecessary.
To reproduce sending a POST request to the user endpoint with a non-unique email.
Specifically
$ nodal new recreate-issue-api
$ cd recreate-issue-api
$ nodal g:model --user
$ nodal db:create
$ nodal db:prepare
$ nodal db:migrate
$ nodal g:controller --for user
$ nodal s
Then POST to the /user/ endpoint twice with
username : test
email : test@test.com
password : password
Then POST again with a unique email
username : test
email : testtest@test.com
password : password
An empty or non-unique value sent in a POST request to an endpoint that implements a field that implements the unique property will return an error as expected, but increments the
id
value of the user table.Nit pick, and I suspect it's possible this just might be how Postgres doest, but it seems potentially unnecessary.
To reproduce sending a POST request to the user endpoint with a non-unique email.
Specifically
Then POST to the /user/ endpoint twice with
Then POST again with a unique email
GET to /user/ Screenshot sequence: