fix api profileSalary

This commit is contained in:
AdisakKanthawilang 2024-03-25 10:46:21 +07:00
parent f7bde0608a
commit e368c4cae8

View file

@ -113,14 +113,14 @@ export class ProfileSalaryController extends Controller {
/**
* API GetById ProfileSalary
*
* @summary GetById ProfileSalary
* @summary GetById Profile
*
* @param {string} id Id ProfileSalaryId
* @param {string} id Id ProfileId
*/
@Get("{id}")
async GetById(@Path() id: string) {
const profileSalary = await this.profileSalaryRepository.findOne({
where: { id },
const profileSalary = await this.profileSalaryRepository.find({
where: { profileId:id },
select: ["id", "date", "amount", "positionSalaryAmount", "mouthSalaryAmount", "profileId"],
});
if (!profileSalary) {
@ -129,22 +129,22 @@ export class ProfileSalaryController extends Controller {
return new HttpSuccess(profileSalary);
}
/**
* API GetLists profile salary
*
* @summary GetLists profile salary
*
*/
@Get()
async GetLists() {
const profileSalary = await this.profileSalaryRepository.find({
select: ["id", "date", "amount", "positionSalaryAmount", "mouthSalaryAmount", "profileId"],
// /**
// * API GetLists profile salary
// *
// * @summary GetLists profile salary
// *
// */
// @Get()
// async GetLists() {
// const profileSalary = await this.profileSalaryRepository.find({
// select: ["id", "date", "amount", "positionSalaryAmount", "mouthSalaryAmount", "profileId"],
// order: { createdAt: "ASC" },
});
// });
// if (!profileSalary) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(profileSalary);
}
// return new HttpSuccess(profileSalary);
// }
}