Update api_controller.js

This commit is contained in:
xfarrow 2024-02-14 10:53:20 +01:00
parent 585e9397c4
commit 99bc453110
1 changed files with 2 additions and 2 deletions

View File

@ -62,7 +62,7 @@ async function registerPerson(req, res){
display_name: req.body.display_name, display_name: req.body.display_name,
date_of_birth: req.body.date_of_birth, date_of_birth: req.body.date_of_birth,
available: req.body.available, available: req.body.available,
enabled: true, enabled: true, // Change this in production
place_of_living: req.body.place_of_living place_of_living: req.body.place_of_living
}) })
.returning("id"); .returning("id");
@ -424,7 +424,7 @@ async function removeOrganizationAdmin(req, res){
// Delete Organization if there are no admins left. // Delete Organization if there are no admins left.
// TODO: If the user instead deletes their entire profile, the organization will not be deleted. Fix. // TODO: If the user instead deletes their entire profile, the organization will not be deleted. Fix.
// TODO: Check what level of transaction we are using to avoid inconsistencies // TODO: Check what level of transaction we are using to avoid inconsistencies. Update: it is READ COMMITTED see https://www.geeksforgeeks.org/transaction-isolation-levels-dbms/
const count = await trx('OrganizationAdministrator') const count = await trx('OrganizationAdministrator')
.count('id as count') .count('id as count')
.where('id', req.body.organization_id); .where('id', req.body.organization_id);