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

Allow users to create custom aliases of their choosing #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sundus-y
Copy link

* Resolves swapagarwal#5
* Add an additional optional param called :alias to allow users to pass
  in a custome key for the url to be saved with.
* Throw a 500 error is key already exists in the system.

if custom_key
key = custom_key
halt 500, 'Duplicate Key' if Link.get(key)
Copy link
Owner

Choose a reason for hiding this comment

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

4xx seems to be more appropriate here. Let's think on what's the best status code to return in this use-case. What about 409?

Copy link
Owner

Choose a reason for hiding this comment

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

Or 422?

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

Successfully merging this pull request may close these issues.

None yet

2 participants