* fix(api): remove unused parts of schema
isX are unused and prisma does not care what's in the db if you do not
ask for it.
* fix: add isCollegeAlgebraPyCertV8
* feat(api): add socials links endpoint
* Sort the typo in body call
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
* Revert "Sort the typo in body call"
This reverts commit 0588d3d70d.
---------
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
While this lets us write slightly better tests, I don't think it's worth
the extra complexity. For example, it interferes with the creation of
test databases. We could work around this, but I'd rather keep things
simple.
* chore(api): pull prod db schema
* manual user model schema
* adjust json types
* temp: fix object type
* adjust schema with Json types
* fix: oliver found my bugs 🐛
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* ttl to int, remove github from user
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* fix: remove unused parts of the prisma schema
---------
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
fix: allow fastify to set content-type dynamically
We can set content-type: application/json for specific routes, but
doing so ends up with confusing, over-engineered code.
Instead we should take care when auditing the endpoints.
* test: allow mocking of env vars
Since utils/env is a module, we can mock it to control env vars in
tests. However, it's not compatible with building the server in
setupFilesAfterEnv, so, instead, we can use a utility function to keep
things DRY.
* fix: update type of fastifyTestInstance
* chore: add comment about sts preload
* chore: rename header plugin
* test: add get util + provide origin on request
* feat: add cors headers
* chore: add TODO
* feat: add response codes
* fix: update TypeBox imports
* refactor: convert inject based tests to supertest
* feat: require authentication to use route
* test: confirm db is updated as expected
* fix: respond appropriately on error
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
* feat(api): add sentry plugin
Apply suggestions from code review
Revert "feat(api): add sentry plugin"
This reverts commit fcde4ee03e9b83e335a6a2bccd490490e9993597.
install sentryNode
WIP: create sentry debug
WIP: find out why use errorhandler isn't typed correct
install sentry
add the deleted sentry code
create sentry plugin
* fix error found through sentry
* Polish sentry plugin
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
* duplicate the changes made in the other plugin
* add done to seterrorHandler
* Fix a typo in sentry option
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
* Stop the dns from running if a DSN wasn't provided
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
* Polish the function and check the variable value
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
* check the dsn dashboard in the env
* export dsn value if it isn't sentrydashboard
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
* when the value is undefined init errors
* revert the if statement
* throw an error whenever an environment variable is not right
---------
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>