Long pickup slot kick-message fails without explaining why
Summary
Removing a foodsaver from a pickup slot with a message longer than 255 bytes fails with an unspecific error "bad request". There is also no indication on the modal that the message field is limited to a certain length. To the typical user, it seems like the site is broken, because there is no indication of the actual issue.
Steps to reproduce
Remove a foodsaver from a pickup slot with a kick-message longer than 255 characters.
What is the current bug behavior?
An unspecific error is shown:
Entfernen fehlgeschlagen: Error: HTTP Error 400: Bad Request during DELETE https://foodsharing.de/api/stores/99999/pickups/2023-01-01T00:00:00.000Z/999999
What is the expected correct behavior?
A hint about the message length limit or at least a clear error message.
Possible fixes
- The modal could show the length constraint, either as a hint or with an interactive indication of characters left/length exceeded.
- The api action could check the validator for the length violation and return a more succinct error response.