migration change on default value and encrypted storage

This commit is contained in:
Julian Krauser 2025-05-04 19:01:06 +02:00
parent 03a5bb3592
commit a476bf6823
11 changed files with 82 additions and 36 deletions

View file

@ -129,4 +129,28 @@ export default abstract class UserService {
throw new DatabaseActionException("SELECT", "userRoles", err);
});
}
/**
* @description get secret and routine by iser
* @param userId string
* @returns {Promise<user>}
*/
static async getUserSecretAndRoutine(userId: string): Promise<user> {
//TODO: not working yet
return await dataSource
.getRepository(user)
.createQueryBuilder("user")
.select("user.id")
.addSelect("user.secret")
.addSelect("user.routine")
.where("user.id = :id", { id: userId })
.getOneOrFail()
.then((res) => {
return res;
})
.catch((err) => {
console.log(err);
throw new DatabaseActionException("SELECT", "user credentials", err);
});
}
}