Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
fix(adeli): fix adeli number sanitizing
Browse files Browse the repository at this point in the history
  • Loading branch information
cberthou committed May 3, 2022
1 parent 1d4fdd8 commit 6cb9093
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/services/__tests__/adeli-resquest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { requestAdeli } from "../adeli/request";
jest.mock("axios");
describe("requestAdeli", () => {
beforeEach(() => {
(axios.get as jest.Mock).mockReset();
// @ts-ignore
axios.get.mockImplementation(() => Promise.resolve({ data: { rows: [] } }));
});
Expand Down
2 changes: 1 addition & 1 deletion src/services/adeli/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { zip } from "../../utils/array";
import config from "../config";

const formatRequestedAdeli = (adeliId: string) =>
adeliId.replace(".", "").replace(" ", "").replace("/", "").padStart(10, "0");
adeliId.replace(/\./g, "").replace(/ /g, "").replace(/\//, "").padStart(10, "0");

const rowColumnsToObject = <Column>(row: string[], columns: Column[]) =>
Object.fromEntries(zip(columns, row));
Expand Down

0 comments on commit 6cb9093

Please sign in to comment.