Open monzim opened 1 month ago
I was about to ask you to work on issue #65 as that's similar as well. Thanks a lot!
Hey @monzim could you stack on a commit or two to help me merge this?
Hey @monzim could you stack on a commit or two to help me merge this?
Sure
This PR resolves two key issues related to petition handling and improves the overall error experience in the application. The fixes include handling invalid petition IDs and missing petitions more gracefully, as well as introducing a new error component for better user feedback.
Issue Resolved: #83 and #65
Changes:
Saved draft petitions are accessible by public fixed
Petition ID Validation Fixed:
Fixed the issue where entering a string instead of a number as the petition ID would break the app. Now, invalid IDs are properly handled, and the user sees an appropriate error.
Petition Not Found Handling:
Improved the handling of cases where the petition ID is valid but does not exist in the database. Users now see a proper 404 error instead of a generic failure.
ErrorGui
):Added a reusable
ErrorGui
component that centralizes error display logic. This component is now used across the app, making it easier to maintain and standardizing the error messages.Refactor
NotFound
Component:Updated the
NotFound
component to leverage the newErrorGui
for displaying 404 errors, keeping things consistent.Update the PetitionActionButton
Screenshots:
imag1.png
: Shows the old broken state when a string was used as a petition ID.image1.png
: Displays the new error component for the 404 page.This PR improves error handling and enhances the user experience when dealing with invalid or missing petitions.