api update profile amount

This commit is contained in:
kittapath 2024-12-14 12:00:45 +07:00
parent 2f5aef96f3
commit 0c7c3361f6
3 changed files with 319 additions and 273 deletions

View file

@ -2007,9 +2007,7 @@ export class ProfileController extends Controller {
process.env.AUTH_ACCOUNT_SECRET,
{ expiresIn: "15m" },
);
// console.log("[token]",token);
const link = process.env.URL + "/verifyemail?upn=" + token;
// console.log("[link]",link);
await new CallAPI()
.PostData(req, "/placement/noti/send-mail", {
@ -3964,6 +3962,28 @@ export class ProfileController extends Controller {
return new HttpSuccess({ data: data, total });
}
/**
* API Update amount
*
* @summary Update amount (ADMIN)
*
*/
@Get("update-amount")
async updateProfileAmount(@Request() request: RequestWithUser) {
const profiles = await this.profileRepo.find({
order: { profileSalary: { order: "DESC" } },
relations: ["profileSalary"],
});
profiles.map(async (x) => {
const amount = x.profileSalary[0];
x.amount = amount?.amount ?? 0;
x.amountSpecial = amount?.amountSpecial ?? 0;
x.positionSalaryAmount = amount?.positionSalaryAmount ?? 0;
await this.profileRepo.save(x);
});
return new HttpSuccess();
}
/**
* API
*
@ -8274,7 +8294,6 @@ export class ProfileController extends Controller {
receiverUserId: x.id,
notiLink: "",
}));
console.log(profileNoti);
await new CallAPI()
.PostData(req, "/placement/noti/profiles", {
subject: body.subject,