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

API can't edit a shake #692

Open
spaceninja opened this issue Apr 16, 2023 · 1 comment
Open

API can't edit a shake #692

spaceninja opened this issue Apr 16, 2023 · 1 comment

Comments

@spaceninja
Copy link
Member

On MLTSHP.com you can edit a shake's name, description, and thumbnail. This is not exposed in the API.

@spaceninja
Copy link
Member Author

Suggestion: Add the following endpoint:

POST /api/shake_id/(int: shakeid)

(this should also be available on the /api/shake_name and /api/shake_user endpoints.)

Updates a shake's editable details

Note that name in this case refers to the URL path to the shake. e.g., for https://mltshp.com/weloveamberandandre the pathname is weloveamberandandre.

Form Parameters

  • title - text for the shake title
  • name - text for the shake name
  • description - text for the shake description (optional)

Status Codes
200 OK – the response is a shake for the requested shake


We'll also need an endpoint to upload a thumbnail for a shake:

POST /api/shake_id/(int: shakeid)/thumbnail

(this should also be available on the /api/shake_name and /api/shake_user endpoints.)

Sets the submitted image as the thumbnail for a shake. Images should be provided as multipart/form-data request bodies.

Parameters

  • shakeid – the shake’s numeric ID

Form Parameters

  • file - the file data of the image to upload

Status Codes
200 OK – the response is a shake for the requested shake


It may make sense to merge these together into a single "edit shake" endpoint, but given the complexities around uploading images as multipart/form-data, it might make sense to keep the simpler endpoint for just editing the shake details.

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

1 participant