Skip to content

Commit

Permalink
remove-clean
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-bompart committed Feb 6, 2024
1 parent 54afc33 commit 86f770d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scripts/cleaning/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ function getClient(accessToken, env, organizationId) {
}

function wasCreatedBefore(amount, unit) {
return (resource) => {
return (key) => {
const limit = moment().subtract(amount, unit);
for (const createField of ['createdDate', 'created']) {
if (resource[createField]) {
return moment(resource[createField]).isBefore(limit);
}
}
return moment(key.createdDate).isBefore(limit);
};
}

Expand Down

0 comments on commit 86f770d

Please sign in to comment.