Fixed data type of hasStripeData in member importer
refs https://github.com/TryGhost/Team/issues/1076 - What appeared to be a "boolean" by nature and name, the hasStripeData was holding a result of "find" method - and object or an undefined value - Fixed the typing, to avoid ambiguity in the future
This commit is contained in:
parent
ac01fc5e42
commit
4d26c50e0b
@ -86,9 +86,9 @@ module.exports = class MembersCSVImporter {
|
||||
const numberOfBatches = Math.ceil(rows.length / batchSize);
|
||||
const mappedCSV = membersCSV.unparse(rows, columns);
|
||||
|
||||
const hasStripeData = rows.find(function rowHasStripeData(row) {
|
||||
const hasStripeData = !!(rows.find(function rowHasStripeData(row) {
|
||||
return !!row.stripe_customer_id || !!row.complimentary_plan;
|
||||
});
|
||||
}));
|
||||
|
||||
await fs.writeFile(outputFilePath, mappedCSV);
|
||||
|
||||
|
@ -246,7 +246,7 @@ describe('Importer', function () {
|
||||
|
||||
result.batches.should.equal(2);
|
||||
should.exist(result.metadata);
|
||||
|
||||
should.equal(result.metadata.hasStripeData, false);
|
||||
fsWriteSpy.calledOnce.should.be.true();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user