Merge branch 'develop' into develop-Bright
This commit is contained in:
commit
83bd29b8e6
2 changed files with 33 additions and 9 deletions
|
|
@ -22,6 +22,18 @@ export class ProfileAvatarController extends Controller {
|
||||||
return new HttpSuccess(lists);
|
return new HttpSuccess(lists);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get("profileId/{id}")
|
||||||
|
async getProfile(@Path() id: string) {
|
||||||
|
const profile = await this.profileRepository.findOne({
|
||||||
|
select: ["avatar", "avatarName"],
|
||||||
|
where: { id },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
||||||
|
return new HttpSuccess(profile);
|
||||||
|
}
|
||||||
|
|
||||||
@Get("select/{profileId}/{id}")
|
@Get("select/{profileId}/{id}")
|
||||||
public async selectAvatar(@Path() profileId: string, @Path() id: string) {
|
public async selectAvatar(@Path() profileId: string, @Path() id: string) {
|
||||||
const result = await this.avatarRepository.findOneBy({ id: id });
|
const result = await this.avatarRepository.findOneBy({ id: id });
|
||||||
|
|
|
||||||
|
|
@ -496,15 +496,27 @@ export class ProfileController extends Controller {
|
||||||
|
|
||||||
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
||||||
const _caregiver = await this.profileRepo.find({
|
const _caregiver = await this.profileRepo
|
||||||
relations: { posLevel: true, posType: true },
|
.createQueryBuilder("profile")
|
||||||
});
|
.leftJoinAndSelect("profile.posLevel", "posLevel")
|
||||||
const _commander = await this.profileRepo.find({
|
.leftJoinAndSelect("profile.posType", "posType")
|
||||||
relations: { posLevel: true, posType: true },
|
.skip((1 - 1) * 20)
|
||||||
});
|
.take(20)
|
||||||
const _chairman = await this.profileRepo.find({
|
.getMany();
|
||||||
relations: { posLevel: true, posType: true },
|
const _commander = await this.profileRepo
|
||||||
});
|
.createQueryBuilder("profile")
|
||||||
|
.leftJoinAndSelect("profile.posLevel", "posLevel")
|
||||||
|
.leftJoinAndSelect("profile.posType", "posType")
|
||||||
|
.skip((1 - 1) * 20)
|
||||||
|
.take(20)
|
||||||
|
.getMany();
|
||||||
|
const _chairman = await this.profileRepo
|
||||||
|
.createQueryBuilder("profile")
|
||||||
|
.leftJoinAndSelect("profile.posLevel", "posLevel")
|
||||||
|
.leftJoinAndSelect("profile.posType", "posType")
|
||||||
|
.skip((1 - 1) * 20)
|
||||||
|
.take(20)
|
||||||
|
.getMany();
|
||||||
|
|
||||||
const caregiver = _caregiver.map((_data) => ({
|
const caregiver = _caregiver.map((_data) => ({
|
||||||
id: _data.id,
|
id: _data.id,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue