Baobab
Baobab copied to clipboard
Make responses editable by admins - Backend
Create a new AnswerAdminAPI which has a PUT method that does the following:
- Accept event_id, answer_id and value parameters
- Ensure the logged in user is an admin for the given event
- Update the answer with the given ID to the given value
- Log somewhere (eg an AnswerAudit table) the original value of the answer and the update made to it, with the timestamp and user_id of the update.?
TODO: Should this just create a new response and leverage the existing audit mechanism?
It would be consistent and nicer to have it follow the existing audit mechanism (relying on is_active
columns). When doing an actual audit, the queries would be consistent and follow the same pattern (filtering by is_active
).