MLTSHP / mltshp

Source for the application that runs mltshp.com
https://mltshp.com/
Mozilla Public License 2.0
50 stars 21 forks source link

API can't edit a shake #692

Open spaceninja opened 1 year ago

spaceninja commented 1 year ago

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

spaceninja commented 1 year ago

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

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

Form Parameters

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.