Changes function return signatures in Repository and Service Interfaces
I went with array but I think ideally the insert and post function should simply return an ID, so maybe int is appropriate here?
Updates test case in the Department Service
Re-organize and add tests for API endpoint
Fixes an issue with memory leaks in the tests
Not sure how long tests were taking previously, however without this in place I couldn't even successfully run the tests. They were taking a little over a minute for me after the changes.
Fixes a couple of lint issues that were present in the code
Need to determine the appropriate permission for the new endpoint. Previously there was no permission applied at all. In existing ConCom code, it was implied that if you had site.concom.permissions you would be able to create new departments without further checks. The new convention is api.[action].[resource] in most places, but it is not clear to me who would have the site.concom.permissions to appropriately grant this to users, so I chose to not add anything for now.
Perhaps site.concom.permissions would be most appropriate to start?
This PR adds an endpoint to create Departments.
array
but I think ideally theinsert
andpost
function should simply return an ID, so maybeint
is appropriate here?Need to determine the appropriate permission for the new endpoint. Previously there was no permission applied at all. In existing ConCom code, it was implied that if you had
site.concom.permissions
you would be able to create new departments without further checks. The new convention isapi.[action].[resource]
in most places, but it is not clear to me who would have thesite.concom.permissions
to appropriately grant this to users, so I chose to not add anything for now.Perhaps
site.concom.permissions
would be most appropriate to start?