Fixed error for clients without a previous credit
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
e8792d5686
commit
b0d291e49c
|
@ -336,8 +336,8 @@ module.exports = Self => {
|
|||
order: 'id DESC'
|
||||
}, ctx.options);
|
||||
|
||||
const lastAmount = lastCredit.amount;
|
||||
const lastWorkerId = lastCredit.workerFk;
|
||||
const lastAmount = lastCredit && lastCredit.amount;
|
||||
const lastWorkerId = lastCredit && lastCredit.workerFk;
|
||||
const lastWorkerIsManager = await models.Account.hasRole(lastWorkerId, 'manager', ctx.options);
|
||||
|
||||
if (lastAmount == 0 && lastWorkerIsManager)
|
||||
|
|
Loading…
Reference in New Issue