-
-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Labels
Ready for DevelopmentAutomatically assigned to issues that are ready to be picked upAutomatically assigned to issues that are ready to be picked upTestimony FlowbackendBackend DevelopmentBackend DevelopmentenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Problem
When an Admin deletes a reported testimony for a bill from the admin view, we want that bill's testimony counts (i.e. endore/neutral/oppose/total) to reflect the new totals. Currently, the testimony counts are not updated when deleting a testimony through the admin view. This is because we have two delete paths for deleting testimony - one in a Firebase function (that correctly updates counts on deletion) and one through an edge function in the Next.js API (that does not update counts). The admin page uses the latter.
Success Criteria
- When deleting a reported testimony for a bill through the Admin page, that bill's testimony counts should be updated
- e.g. If a bill has 10 Endorse and 4 Oppose testimonies and one of the Endorse testimony is deleted, the bill should now have 9 Endore and 4 Oppose in its testimony counts.
- It may be prudent to unify the two testimony deletion paths for more consistent behavior going forward - given that deleting testimony tends to be an admin-facing process, I don't think the cold start latency concerns of the Firebase function should be considered a blocker (and it seems that the Firebase Function
deleteTestimonyis the more fully-featured path).
Additional Notes
- The delete path the Admin page currently uses:
maple/components/api/delete-testimony.ts
Line 13 in 1f36c58
return mapleClient.delete(`/api/users/${uid}/testimony/${tid}`) - The
deleteTestimonyfirebase function (that has behavior to update testimony counts):...updateTestimonyCounts(this.bill, this.publication, undefined) - You should be able to test this sufficiently by giving yourself admin permissions when running the backend locally in Docker by using the default admin account found in the Firebase Emulator UI's authentication tab. If you feel you need admin permissions on the deployed DEV site to fully test this, reach out in #maple-developers in Slack.
Metadata
Metadata
Assignees
Labels
Ready for DevelopmentAutomatically assigned to issues that are ready to be picked upAutomatically assigned to issues that are ready to be picked upTestimony FlowbackendBackend DevelopmentBackend DevelopmentenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers