Repository navigation
Let users edit, unpublish and delete their own foods - #10
Merged
Merged
Conversation
Foods a user created could be edited on web only, unpublished only from the web edit form, and never deleted. - API: add DELETE /api/foods/:id for the owner, behind a new foods:delete permission (on by default for users). - Web: the catalog detail gains Stop sharing and Delete next to Edit; the edit form is titled "Edit food", can delete, and returns to the catalog after saving. - Mobile: the catalog detail sheet gains Edit, Stop sharing and Delete; the food screen now also edits an existing food. Deleting asks for confirmation first, as it cannot be undone. Also clear a stale auth error (such as "email already registered") as soon as a sign-up or login field is edited, on web and mobile. The browser blocks submitting a too-short password itself, so the old message used to stay next to a different email. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Managing your own foods (web + mobile)
DELETE /api/foods/:id, owner only, behind a newfoods:deletepermission (on by default for users, listed in the admin Permissions screen).FoodScreentakes an optionalfoodand edits it withPUT(previously mobile could not edit a food at all).Stale auth error (web + mobile)
Why
Foods a user created could be edited on web only, unpublished only from the web edit form, and never deleted.
Reviewer notes
foodIdisonDelete: SetNull, so past days should be unaffected by a delete. That path was not exercised end to end.foods:deletefalls back to the in-code default like the other operations.Testing
flutter analyzeshows only the 7 existing infos, Flutter tests pass.🤖 Generated with Claude Code