Skip to content

Commit

Permalink
tech(script): fix parsing param in delete and anonymise script
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelB authored Nov 20, 2024
1 parent d0df70b commit 2387600
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class DeleteAndAnonymiseOrgnizationLearnerScript extends Script {
permanent: true,
options: {
organizationLearnerIds: {
type: '<array>number',
type: 'string',
describe: 'a list of comma separated organization learner ids',
demandOption: true,
coerce: commaSeparatedNumberParser(),
Expand All @@ -28,7 +28,6 @@ export class DeleteAndAnonymiseOrgnizationLearnerScript extends Script {
organizationLearnerRepository = { removeByIds },
}) {
const engineeringUserId = process.env.ENGINEERING_USER_ID;

logger.info(`Anonymise ${options.organizationLearnerIds.length} learners`);
await DomainTransaction.execute(async () => {
await campaignParticipationRepository.removeByOrganizationLearnerIds({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ describe('DeleteAndAnonymiseOrgnizationLearnerScript', function () {
const { options } = script.metaInfo;

expect(options.organizationLearnerIds).to.deep.include({
type: '<array>number',
type: 'string',
describe: 'a list of comma separated organization learner ids',
demandOption: true,
});
expect(options.organizationLearnerIds.coerce).to.be.a('function');
});

it('parses list of organizationLearnerIds', async function () {
Expand Down

0 comments on commit 2387600

Please sign in to comment.