Skip to content

Commit

Permalink
shift success and accountNumber fields forward in output
Browse files Browse the repository at this point in the history
consistent with error output
  • Loading branch information
dangowans committed Sep 1, 2021
1 parent 7bd6f68 commit 370cb4c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ export const getClearanceByAccountNumber = async (accountNumber) => {
return parsedTable_value;
});
const certificate = cleanRawCertificateOutput(parsedTable);
const response = Object.assign(certificate, {
const response = Object.assign({
success: true,
accountNumber,
certificateURL
});
}, certificate);
return response;
}
catch (error) {
Expand Down
10 changes: 5 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export const getClearanceByAccountNumber = async (accountNumber: string): Promis
await page.$eval(config.clearanceResult_certificateLinkSelector, (linkEle: HTMLAnchorElement) => {
linkEle.click();
})
.catch(() => {
throw new Error("Clearance certificate link not found.");
});
.catch(() => {
throw new Error("Clearance certificate link not found.");
});

await page.waitForSelector("body");

Expand All @@ -113,11 +113,11 @@ export const getClearanceByAccountNumber = async (accountNumber: string): Promis

const certificate = cleanRawCertificateOutput(parsedTable);

const response = Object.assign(certificate, {
const response = Object.assign({
success: true,
accountNumber,
certificateURL
});
}, certificate);

return response;

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cityssm/wsib-clearance-check",
"version": "2.0.1",
"version": "2.0.2",
"description": "A tool to scrape the clearance certificate status from the WSIB Online Services website.",
"keywords": [
"wsib",
Expand Down

0 comments on commit 370cb4c

Please sign in to comment.