activation link function update

This commit is contained in:
xfarrow
2024-03-04 15:50:14 +01:00
parent 5ef0317833
commit 797a69fe34
3 changed files with 15 additions and 8 deletions

View File

@ -128,10 +128,17 @@ async function deletePerson (personId) {
.del();
}
async function enablePerson (personId) {
await knex('Person')
async function confirmActivation (personId) {
await knex.transaction(async (tr) => {
await knex('Person')
.where('id', personId)
.update({enabled: true});
await tr('ActivationLink')
.where('person_id', personId)
.del();
});
}
// Exporting a function
@ -145,5 +152,5 @@ module.exports = {
registerPerson,
updatePerson,
deletePerson,
enablePerson
confirmActivation
};