Skip to content

[Role API] When Update end point is called with an already existing role name, the update happens instead of returning 'already exists' message #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sdgun opened this issue Jun 2, 2021 · 2 comments

Comments

@sdgun
Copy link
Collaborator

sdgun commented Jun 2, 2021

Steps
Call update end point for a role by changing the role name to another existing role name

Current behavior
Update happens

Expected behavior
Should not allow duplicate role names(create end point has this restriction)

@sdgun sdgun added bug Something isn't working P1 Role-Matching-Intake labels Jun 2, 2021
@eisbilir
Copy link
Member

eisbilir commented Jun 2, 2021

@sdgun
I found the updated record:

Postman 2021-06-03 01 03 26

The first "React Developer 2" role actually not exists in database.
I explained it here: #290 (comment)
Now after the above update, we actually have a "React Developer 2" Role.
When I try to update another Role's name to "React Developer 2" I get the error now:
Postman 2021-06-03 01 05 00

@nikolay83
The undeleted record issue #290 caused this particular issue.
Our update endpoint follow the same not allow duplicate name restriction with create endpoint.
And it's not possible to create a new role with duplicate name because Role model has a uniqe name index.

nikolay83 added a commit that referenced this issue Jun 3, 2021
@sdgun sdgun added the Dev env label Jun 4, 2021
@sdgun
Copy link
Collaborator Author

sdgun commented Jun 4, 2021

Verified with some more roles and update returned a proper message without letting to update role name to an existing role name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants