Skip to content
Snippets Groups Projects
Commit 12645f17 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Merge branch 'refactor_enrollments' into 'development'

Refactor enrollments route to include query building

Changes:
- Add error handling in the database query function. When a database error
occurs, it is logged in the server and a plain text response is returned to the
user.
- Implement building of SQL queries inside the API, which removes the
  need to have stored functions/procedures on the database, since the former
approach is not flexible or efficient to maintain/extend.
- Use route chaining to determine which function will build the query
  that needs to be executed. The last function is the one that actually
  sends the query to the database and send the response.

Future Work:
- Instead of returning a plain text response, return a HTTP 501 status,
  which is currently not possible. When one attempts to send such status
  the framework throws an error that the headers were already sent for
  the current request.
- Chaining based on the route might not be the best solution here.

See merge request !7
parents 55ff5eca 501b00e6
No related branches found
No related tags found
1 merge request!7Refactor enrollments route to include query building
Pipeline #
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment