hack4impact-calpoly/the-land-conservancy

Admin delete & edit a shift

Closed this issue · 0 comments

Description

Admins should be able to view shifts from the volunteer log and either edit or delete any shift by clicking on one of the icons in the row (see figma)

  • edit shift takes you to the admin view of /log-hours, but only the # of hours can be edited (disable the name field)

this may involve:

  • reviewing the backend to see how to make the calls to delete and edit a shift (these endpoints will be merged in soon)
  • viewing the results of the calls via postman or online in our atlas project to make sure it hooks up to the backend properly
  • viewing the logic for how /events link to the correct /log-hours page
  • when linking to the log-hours page to edit, pass the volunteer as state in the link (see resource and newest updates to main / pull request #108 )
  • making sure you have an admin account (isAdmin: true in Mongo) but is also connected to cognito or you can't log in :P
  • ****implementing delete first so possibly another task can do some of the admin edit-hours frontend work (feel free to ask about that for updates)
  • recommended order of implementation:
    • delete frontend,
    • delete connect to backend,
    • edit frontend,
    • edit connect to backend

NOTE: Bora already made a modal for deleting a shift, use it :)

Checklist

  • connects to the backend
  • the frontend display is updated accordingly : the VolunteerLog shows the updated shifts without having to refresh the page
  • ^ the state variables in the app(aka allShifts) are updated accordingly after a shift edit/delete -> so
  • edit shift: takes you to the admin view of /log-hours, but only the # of hours can be edited (disable the name field) (check in with me or sam to see if he completed the admin log-hours frontend view already; if not, it shouldn't take long to implement)
  • edit shift: when you go to /log-hours page, button says "update hours" instead of "submit"
  • delete shift: brings up a popup(modal) asking to confirm they want to delete (see my NOTE above)