diff --git a/api/src/integrations/core/datasource.js b/api/src/integrations/core/datasource.js index c79af8625..9afcc91ff 100644 --- a/api/src/integrations/core/datasource.js +++ b/api/src/integrations/core/datasource.js @@ -230,12 +230,12 @@ class CoreDataSource { // Create a new collections if possible. if (savedRecord._schemaName === 'MineBCMI') { - await this.createorUpdateCollections(collectionUtils, permitUtils, permitInfo.permit, savedRecord); + await this.createorUpdateCollections(collectionUtils, permitUtils, permitInfo.validPermit, savedRecord); } else { if (!savedRecord.length > 0 || savedRecord[0].status !== 'success') { throw Error('processRecord - savedRecord is null.'); } - await this.createorUpdateCollections(collectionUtils, permitUtils, permitInfo.permit, savedRecord[0].object[0]); + await this.createorUpdateCollections(collectionUtils, permitUtils, permitInfo.validPermit, savedRecord[0].object[0]); } this.status.itemsProcessed++; @@ -277,7 +277,7 @@ class CoreDataSource { // Do not use 'G-4-352' for Lumby // https://bcmines.atlassian.net/browse/NRPT-684 - return !nrptiRecord.name === 'Lumby Mine' && permit.permit_no === 'G-4-352'; + return !(nrptiRecord.name === 'Lumby Mine' && permit.permit_no === 'G-4-352'); } return false; } diff --git a/api/src/integrations/core/mine-utils.js b/api/src/integrations/core/mine-utils.js index 1406301dd..375f43a09 100644 --- a/api/src/integrations/core/mine-utils.js +++ b/api/src/integrations/core/mine-utils.js @@ -132,7 +132,7 @@ class Mines extends BaseRecordUtils { // The permit information is updated separately and the NRPTI record will not contain it. // Copy permit information over before updating to preserve it. nrptiRecord.permittee = permitInfo.permittee; - nrptiRecord.permit = permitInfo.permit; + nrptiRecord.permit = permitInfo.validPermit; nrptiRecord.permitNumber = permitInfo.permitNumber; return super.updateRecord(nrptiRecord, existingRecord);