ita-social-projects / StreetCode

MIT License
17 stars 8 forks source link

[Admin/Editor/Categories] Frontend Displays False Positive Confirmation Message on Unsuccessful Category Creation #1723

Open arisssha opened 1 week ago

arisssha commented 1 week ago

Environment: macOS 13.6.8/Google Chrome 128.0.6613.119 Reproducible: always Build found: commit 195a644

Preconditions The user is logged in as an admin on the Стріткод page.

Steps to reproduce

  1. Click the "Едітор" button in the left navigation pane.
  2. Click the "Додати нову категорію" button.
  3. Enter valid data in the "Назва" field (e.g., "Test1").
  4. Attempt to upload a picture in an unacceptable format to the "Картинка" field (e.g., "pdf" file)
  5. Click the "Зберегти" button.
  6. Observe the confirmation message displayed.

Actual result Despite the category creation being unsuccessful due to the invalid picture format, the confirmation message "Категорію успішно додано!" is displayed. The server responds with a 400 Bad Request status code, indicating an issue with the request due to the invalid picture format.

https://github.com/user-attachments/assets/06c4ca73-01d8-4f60-b4f1-16aec392f4d8

Expected result The "Зберегти" button should not be activated when the picture format is invalid. A proper error message should be shown indicating that the picture format is not acceptable.

User story and test case links User story: #833 Related bug: https://github.com/orgs/ita-social-projects/StreetCode/issues/1724

mythter commented 5 days ago

Fixed in PR #1402