Skip to content
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

inversify-express-utils: BaseHttpController's conflict should take an argument #366

Open
tgiardina opened this issue Aug 6, 2020 · 0 comments

Comments

@tgiardina
Copy link

This is a feature request for inversify-express-utils. Controllers that extend BaseHttpController have access to a this.conflict method, but this method does not take any arguments. Using this.json is an easy workaround, but I would still like this.conflict to take an optional generic argument.

Expected Behavior

I would expect this.conflict to take a generic argument that allows me to explain why the conflict occurred.

Current Behavior

I cannot provide an argument, so this.conflict just returns a 409 code.

Context

Let's say I get a POST /users request. It may conflict because (1) the provided username already exists or (2) the provided email already exists. The API should return which conflict actually occurred.

@PodaruDragos PodaruDragos transferred this issue from inversify/InversifyJS Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant