Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
a1f481deb1
|
@ -165,8 +165,8 @@ module.exports = Self => {
|
|||
const sql = ParameterizedSQL.join(stmts, ';');
|
||||
const days = await conn.executeStmt(sql, myOptions);
|
||||
|
||||
let previousWorkerFk = days[index][0].workerFk;
|
||||
let previousReceiver = days[index][0].receiver;
|
||||
let previousWorkerFk = days[index][0]?.workerFk;
|
||||
let previousReceiver = days[index][0]?.receiver;
|
||||
|
||||
const workerTimeControlConfig = await models.WorkerTimeControlConfig.findOne(null, myOptions);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ module.exports = Self => {
|
|||
const url = `${salix.url}worker/${args.workerId}/time-control?timestamp=${timestamp}`;
|
||||
ctx.args.url = url;
|
||||
|
||||
await models.WorkerTimeControl.updateMailState(ctx, ctx.workerId, myOptions);
|
||||
await models.WorkerTimeControl.updateMailState(ctx, ctx.args.workerId, myOptions);
|
||||
return Self.sendTemplate(ctx, 'weekly-hour-record');
|
||||
};
|
||||
|
||||
|
|
|
@ -380,7 +380,6 @@ class Controller extends Section {
|
|||
|
||||
updateWorkerTimeControlMail(state, reason) {
|
||||
const params = {
|
||||
workerId: this.worker.id,
|
||||
year: this.date.getFullYear(),
|
||||
week: this.weekNumber,
|
||||
state
|
||||
|
@ -389,7 +388,7 @@ class Controller extends Section {
|
|||
if (reason)
|
||||
params.reason = reason;
|
||||
|
||||
const query = `WorkerTimeControls/updateWorkerTimeControlMail`;
|
||||
const query = `WorkerTimeControls/${this.worker.id}/updateMailState`;
|
||||
this.$http.post(query, params).then(() => {
|
||||
this.getMailStates(this.date);
|
||||
this.getWeekData();
|
||||
|
|
|
@ -201,7 +201,7 @@ describe('Component vnWorkerTimeControl', () => {
|
|||
controller.date = today;
|
||||
controller.weekNumber = 1;
|
||||
|
||||
$httpBackend.expect('POST', 'WorkerTimeControls/updateWorkerTimeControlMail').respond();
|
||||
$httpBackend.expect('POST', 'WorkerTimeControls/1/updateMailState').respond();
|
||||
controller.isSatisfied();
|
||||
$httpBackend.flush();
|
||||
|
||||
|
@ -236,7 +236,7 @@ describe('Component vnWorkerTimeControl', () => {
|
|||
controller.weekNumber = 1;
|
||||
controller.reason = 'reason';
|
||||
|
||||
$httpBackend.expect('POST', 'WorkerTimeControls/updateWorkerTimeControlMail').respond();
|
||||
$httpBackend.expect('POST', 'WorkerTimeControls/1/updateMailState').respond();
|
||||
controller.isSatisfied();
|
||||
$httpBackend.flush();
|
||||
|
||||
|
|
Loading…
Reference in New Issue