Skip to content

Commit

Permalink
Simplified success messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
kennsippell committed Dec 20, 2024
1 parent a195626 commit 0ccd7c8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/lib/manage-hierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export default class ManageHierarchyLib {

public static async scheduleJob(job: JobParams, queueName: IQueue = getChtConfQueue()) {
await queueName.add(job);

return {
success: true
};
}

public static parseHierarchyAction(action: string = ''): HierarchyAction {
Expand Down
4 changes: 2 additions & 2 deletions src/routes/manage-hierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export default async function sessionCache(fastify: FastifyInstance) {
const isConfirmed = formData.confirmed === 'true';
const job = await ManageHierarchyLib.getJobDetails(formData, contactType, sessionCache, chtApi);
if (isConfirmed) {
const result = await ManageHierarchyLib.scheduleJob(job);
tmplData.success = result.success;
await ManageHierarchyLib.scheduleJob(job);
tmplData.success = true;
} else {
const warningInfo = await ManageHierarchyLib.getWarningInfo(job, chtApi);
tmplData.warningInfo = warningInfo;
Expand Down
8 changes: 0 additions & 8 deletions test/lib/manage-hierarchy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ describe('lib/manage-hierarchy.ts', () => {
instanceUrl: 'http://domain.com',
sessionToken: 'encoded-token',
});

const actual = await ManageHierarchyLib.scheduleJob(jobParams, chtConfQueue);

// Verify the data passed to mockmoveContactQueue
expect(chtConfQueue.add.calledOnce).to.be.true;
});

it('move CHU: subcounty required', async () => {
Expand Down Expand Up @@ -128,9 +123,6 @@ describe('lib/manage-hierarchy.ts', () => {
instanceUrl: 'http://domain.com',
sessionToken: 'encoded-token',
});

await ManageHierarchyLib.scheduleJob(jobParams, chtConfQueue);
expect(chtConfQueue.add.calledOnce).to.be.true;
});
});

Expand Down

0 comments on commit 0ccd7c8

Please sign in to comment.