fix test
This commit is contained in:
parent
7ed90ba142
commit
860989c3cf
2 changed files with 8 additions and 9 deletions
|
|
@ -147,15 +147,12 @@ export class ProfileChangeNameController extends Controller {
|
||||||
profile.prefix = body.prefix ?? profile.prefix;
|
profile.prefix = body.prefix ?? profile.prefix;
|
||||||
await this.profileRepository.save(profile);
|
await this.profileRepository.save(profile);
|
||||||
|
|
||||||
// if (profile != null) {
|
if (profile != null && profile.keycloak != null) {
|
||||||
// const result = await updateName(profile.id, profile.firstName, profile.lastName,req);
|
const result = await updateName(profile.keycloak, profile.firstName, profile.lastName, req);
|
||||||
|
if (!result) {
|
||||||
// const _mapData = {
|
throw new Error(result.errorMessage);
|
||||||
// data: mappedData,
|
}
|
||||||
// total: total,
|
}
|
||||||
// };
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
return new HttpSuccess(data.id);
|
return new HttpSuccess(data.id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,8 @@ export async function updateName(
|
||||||
enabled: true,
|
enabled: true,
|
||||||
credentials: (password && [{ type: "password", value: opts?.password }]) || undefined,
|
credentials: (password && [{ type: "password", value: opts?.password }]) || undefined,
|
||||||
...rest,
|
...rest,
|
||||||
|
firstName,
|
||||||
|
lastName,
|
||||||
}),
|
}),
|
||||||
}).catch((e) => console.log("Keycloak Error: ", e));
|
}).catch((e) => console.log("Keycloak Error: ", e));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue