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

Tags can't be edited due to using the POST method with the API #474

Closed
SebastiaanZ opened this issue Oct 1, 2019 · 0 comments · Fixed by #475

Comments

@SebastiaanZ
Copy link
Member

commented Oct 1, 2019

Currently, the !tag edit subcommand is just an alias of !tag set. This means that if we try to edit an existing tag, the bot will use the POST http method to communicate with the API. Since we're not posting a new tag, but editing an existing entry, the API will reject this request.

Instead of using POST, we should be using PATCH, since we're only partially updating the entry in the database.

@SebastiaanZ SebastiaanZ self-assigned this Oct 1, 2019
SebastiaanZ added a commit that referenced this issue Oct 1, 2019
#474

This commit makes sure we're using the PATCH method to update tags,
instead of the POST method. The problem was that the `!tags edit`
command was an alias of `!tags set`, which uses the POST method to
post new tags to the API.

However, when a tag with a given name already exists, the API will
refuse a POST request in an attempt to update it; we need to use the
PATCH method to the `bot/tags/{tag_name}` endpoint instead.

I fixed this by creating a separate subcommand, `!tags edit`, that
uses the correct PATCH method to update an existing tag.

This commit closes #474
@sco1 sco1 added this to In progress in Bot Tracking Oct 1, 2019
@MarkKoz MarkKoz closed this in #475 Oct 2, 2019
Bot Tracking automation moved this from In progress to Done Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Bot Tracking
  
Done
1 participant
You can’t perform that action at this time.