feat(enseignements): implement enseignements CRUD endpoints #106
Reference in New Issue
Block a user
Delete Branch "feature/api-enseignements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add CRUD API for enseignements (prof-module-promo associations):
key (200/404)
composite key (204/404)
Access control: Employee-only (403 Forbidden)
Tests: 7 unit tests added
Close #29 #30 #31
Sorry for not separating each feature as its own branch. It was easier this way and the code is not very long.
The code is correct, but the folder structure is wrong for the route
/admin/api/enseignements/{idProf}/{idModule}/{idPromo}.
In Fresh, / in a URL corresponds to nested folders in the code.
Current structure:
Structure needed for 3 separate segments (like ue-modules):
Also, the tests are still using mocks instead of actually testing the real handlers.
its ok i do the same
Alright, I’ve checked Fresh’s file routing documentation.
I'm fixing the folder structure to match the route.
I fixed the folder structure for the route and removed the mock tests.
I’m not writing the handler tests for now.
Add CRUD API for enseignements (prof-module-promo associations): - POST /enseignements: Create with validation (201/409) - GET /enseignements/{idProf}/{idModule}/{idPromo}: Read by composite key (200/404) - DELETE /enseignements/{idProf}/{idModule}/{idPromo}: Delete by composite key (204/404) Access control: Employee-only (403 Forbidden) Tests: 7 unit tests added Note: RBAC implementation pending (current access control is temporary)- Replace flat file `[idProf]_[idModule]_[idPromo].ts` with nested structure `[idProf]/[idModule]/[idPromo].ts` - Ensures URL matches `/enseignements/{idProf}/{idModule}/{idPromo}`934a160889toa19a1e6c13lgtm