theCrag / website

theCrag.com: Add your voice and help guide the development of the world's largest collaborative rock climbing & bouldering platform
https://www.thecrag.com/
109 stars 8 forks source link

Unable to remove quality when editing ascent #4241

Open m33i opened 6 months ago

m33i commented 6 months ago

If you previously put a quality grade on your ascent, e.g., "good", and try to unclick it and update the ascent, the API POST request is sent with the "quality" label removed from the call, which causes the ascent to not update the value at all, as seen below:

image

image

image

Remains the same : image

For this to work, the request needs to send at least the "quality" label empty, as shown here (under privateComment), to have an impact on the ascent that you are trying to edit. This updates your ascent correctly and removes the previously selected quality.

image

lordyavin commented 6 months ago

Currently the implementation behaves like the following. Correct me if I'm wrong, I did not code that stuff.

  1. An initial log entry where no quality rating is selected, does not add one for the new ascent.
  2. As long as there is no previous ascent of the route with quality rating, the UI does not pre-select the quality rating.

If I understood you right, you are talking about the use case to change an existing (old) ascent right? If so, it looks like the UI does not respect the case where the ascent data was loaded from the DB. In this case the UI shall clear the quality rating for the ascent as you requested.