Skip to content

Commit

Permalink
#557: show how many "deleted" transactionalEmails were filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Nov 24, 2022
1 parent 04e9568 commit a35ed43
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/metadataTypes/TransactionalEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ class TransactionalEmail extends MetadataType {
const response = this.definition.restPagination
? await this.client.rest.getBulk(baseUri)
: await this.client.rest.get(baseUri);
keyList = Object.keys(this.parseResponseBody(response));
const parsed = this.parseResponseBody(response);
keyList = Object.keys(parsed).filter((item) => parsed[item].status !== 'Deleted');
Util.logger.info(
` - Filtered ${this.definition.type} with status 'deleted': ${
Object.keys(parsed).length - keyList.length
} (downloaded but not saved to disk)`
);
} else {
// Retrieve single
keyList = [key];
Expand Down

0 comments on commit a35ed43

Please sign in to comment.