migration change on default value and encrypted storage
This commit is contained in:
parent
03a5bb3592
commit
a476bf6823
11 changed files with 82 additions and 36 deletions
|
@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue