seas-computing / course-planner

SEAS Course Planning Application. JSDoc Docs at: https://seas-computing.github.io/course-planner/
0 stars 1 forks source link

Courses Admin Controller - Read and auth #96

Closed chrxr closed 4 years ago

chrxr commented 4 years ago

API endpoint for CRUD operations on courses, for courses admin interface.

It is expected that we will need a controller for each interface. Therefore it is not expected that this controller will be used anywhere expect in the courses admin interface.

Question: Is there a built-in technique for providing all CRUD operations easily? https://docs.nestjs.com/recipes/crud

rmainwork commented 4 years ago

As discussed with @natalynyu and @jonseitz we won't be using https://docs.nestjs.com/recipes/crud. This is for the following reasons:

  1. No way to specify response DTOs means that the the controller actions would just be returning raw model instances, rather than a formatted set of that data, like we're doing elsewhere(This would also waste the effort put into #102 by @natalynyu).
  2. The crud package requires you to write a NestJS service using the data-mapper pattern and to inherit from their base service. This is necessary because the @crud decorator requires a service to be provided that is compatible with their base service(active record entity classes are NOT compatible with this)
rmainwork commented 4 years ago

I've edited @chrxr's comment slightly above to add "Auth" to the checkboxes because I'm assuming that we don't want any logged in user to be able to access this controller?

chrxr commented 4 years ago

Currently on hold as app authentication for dev is being reviewed. @rmainseas to open new ticket for dev authentication and include ref in this ticket.

rmainwork commented 4 years ago

Ticket opened #134 for authentication refactoring.