it's having some bugs right now and i think it'll require more time and changes than i expected/have at the moment. the basic change of removing driverid from the form works, but changing that led to other issues which affected multiple files.
current bugs:
when admin edits someone else's availability, it takes them to their own availability page instead of back to the admin one
If admin user is not also a driver, will not be able to edit or delete
DONE: Modified DriverAvailabilityController.java POST so that when creating a new DriverAvailability we automatically use the creator's id and no longer take in id as an input.
DONE: Modify DriverAvailabilityController.java PUT so that when editing DriverAvailability we make sure that the DriverAvailability we intend to edit is really owned by the current user, and we no longer want to set the driver id to the incoming.
NOT DONE: Add the proper validations to GET single and DELETE so that a user can only delete or get their own availabilities and not anyone else
Driver now does not need to type in their Driver Id each time when creating a new driver availability as it now automatically fills in the driver id with the user's current id
Driver id will not be able to set to a different one, should be no option to edit driver id
Users should only be able to see, and therefore edit/delete, their own if their role is only driver. If they are also admin then they still can see/edit/delete other availabilities through the admin tab
No option to type in driver id
Driver id shows up even though user didn't type it in
User can also only see their own unless they go through admin tab
https://project-lindseywn.dokku-14.cs.ucsb.edu/ (when testing, make sure your driver role is toggled to true!) Closes #32
it's having some bugs right now and i think it'll require more time and changes than i expected/have at the moment. the basic change of removing driverid from the form works, but changing that led to other issues which affected multiple files.
current bugs:
No option to type in driver id
Driver id shows up even though user didn't type it in User can also only see their own unless they go through admin tab