no message

This commit is contained in:
kittapath 2024-11-11 14:48:14 +07:00
parent 6055802f10
commit ae249ebc8e
5 changed files with 397 additions and 8 deletions

View file

@ -5278,15 +5278,15 @@ export class ProfileController extends Controller {
"current_holders",
"current_holders.orgRoot",
"profileSalary",
"profileEducations"
"profileEducations",
],
order: {
// profileSalary: {
// order: "DESC",
// },
profileEducations: {
createdAt: "DESC"
}
createdAt: "DESC",
},
},
});
if (!profile) {
@ -5465,9 +5465,10 @@ export class ProfileController extends Controller {
isPosmasterAct: data.length > 0,
posmasterAct: data,
salary: profile ? profile.amount : null,
education: profile && profile.profileEducations.length > 0
? `${profile.profileEducations[0].degree ?? ""}-${profile.profileEducations[0].field ?? ""}`
: "-"
education:
profile && profile.profileEducations.length > 0
? `${profile.profileEducations[0].degree ?? ""}-${profile.profileEducations[0].field ?? ""}`
: "-",
};
if (_profile.child4Id != null) {
@ -7867,4 +7868,47 @@ export class ProfileController extends Controller {
]);
return new HttpSuccess();
}
/**
* API
*
* @summary (USER)
*
*/
@Get("keycloak/user")
async listUserKeycloak(
@Request() request: RequestWithUser,
@Query("page") page: number = 1,
@Query("pageSize") pageSize: number = 10,
@Query() keyword: string = "",
) {
// sort by org
const [profiles, total] = await this.profileRepo
.createQueryBuilder("profile")
.leftJoinAndSelect("profile.roleKeycloaks", "roleKeycloaks")
.where("profile.citizenId LIKE :citizenId", {
citizenId: `%${keyword}%`,
})
.andWhere(keyword != null && keyword != "" ? `profile.citizenId like '%${keyword}%'` : "1=1")
.andWhere(
keyword != null && keyword != ""
? `CONCAT(profile.prefix, profile.firstName," ",profile.lastName) like '%${keyword}%'`
: "1=1",
)
.skip((page - 1) * pageSize)
.take(pageSize)
.getManyAndCount();
const _profiles = profiles.map((_data) => ({
id: _data.id,
firstname: _data.firstName,
lastname: _data.lastName,
email: _data.email,
username: _data.citizenId,
citizenId: _data.citizenId,
roles: _data.roleKeycloaks,
enabled: _data.isActive,
}));
return new HttpSuccess({ data: _profiles, total });
}
}