Skip to content

Commit

Permalink
Update cep.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
larnerdoj committed Mar 12, 2024
1 parent 34583b8 commit f1b1db4
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions src/routes/cep.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { get } from "../service/api.service";
import { CepV2 } from "../types/cep";
import { onlyNumbers } from "../utils/format";

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getByV1 = void 0;
exports.getByV2 = void 0;
const api_service_1 = require("../service/api.service");
const format_1 = require("../utils/format");
const endpointV1 = "/cep/v1/";
const endpointV2 = "/cep/v2/";

export const getBy = (cep: string) => {
return get<CepV2>(endpointV2 + onlyNumbers(cep));
const getByV1 = (cep) => {
return (0, api_service_1.get)(endpointV1 + (0, format_1.onlyNumbers)(cep));
};
const getByV2 = (cep) => {
return (0, api_service_1.get)(endpointV2 + (0, format_1.onlyNumbers)(cep));
};
exports.getByV1 = getByV1;
exports.getByV2 = getByV2;

0 comments on commit f1b1db4

Please sign in to comment.