Baobab icon indicating copy to clipboard operation
Baobab copied to clipboard

Make responses editable by admins - Backend

Open avishkar58 opened this issue 3 years ago • 1 comments

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?

avishkar58 avatar Aug 20 '21 10:08 avishkar58

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).

bdhobare avatar Aug 27 '21 23:08 bdhobare