For issue #12. The endpoint takes any editable shift attributes in the request body and then modifies the shift in the database.
To error check, I decided to first retrieve the existing database entry and then check to make sure the new attributes are safe with the existing ones. The error checking for dates gets a little messy. Do you see a better way?
The jest testing was not making it easy to check for modified shifts. I confirmed that the shift was actually being modified with Postman, but I couldn't integrate it into the tests. I tried outputting the modifying attributes to console.log() but using jest with console.log was not working well.
For issue #12. The endpoint takes any editable shift attributes in the request body and then modifies the shift in the database.
To error check, I decided to first retrieve the existing database entry and then check to make sure the new attributes are safe with the existing ones. The error checking for dates gets a little messy. Do you see a better way?
The jest testing was not making it easy to check for modified shifts. I confirmed that the shift was actually being modified with Postman, but I couldn't integrate it into the tests. I tried outputting the modifying attributes to console.log() but using jest with console.log was not working well.