Continue fix RLS issue of updating user table

This commit is contained in:
Hongbo Wu
2022-07-26 13:41:02 +08:00
parent 29ed803ae5
commit dca9066f19

View File

@ -506,10 +506,9 @@ export function authRouter() {
const updated = await AppDataSource.transaction(
async (entityManager) => {
await setClaims(entityManager, user.id)
return getRepository(User).update(
{ id: user.id },
{ status: StatusType.Active }
)
return entityManager
.getRepository(User)
.update({ id: user.id }, { status: StatusType.Active })
}
)
@ -626,10 +625,9 @@ export function authRouter() {
const updated = await AppDataSource.transaction(
async (entityManager) => {
await setClaims(entityManager, user.id)
return getRepository(User).update(
{ id: user.id },
{ password: hashedPassword }
)
return entityManager
.getRepository(User)
.update({ id: user.id }, { password: hashedPassword })
}
)
if (!updated.affected) {