add import node_fetch from "node-fetch";

This commit is contained in:
Luiz H. R. Silva 2024-06-19 10:33:55 -03:00
parent d614ba0d27
commit 5e04f26bbb
14 changed files with 87 additions and 17 deletions

View file

@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import node_fetch from "node-fetch";
import { respostaComuns } from "p-respostas";
import { z } from "zod";
import { PREFIXO, baseUrlPilao } from "./_variaveis";
@ -20,7 +21,7 @@ export const deletar_registros = ({ emDesenvolvimento, cliente: { conta, produto
const tamanhoBlocos = 1000;
while (codigos.length > 0) {
const bloco = codigos.splice(0, tamanhoBlocos);
const resp = yield fetch(url.toString(), {
const resp = yield node_fetch(url.toString(), {
method: "POST",
body: JSON.stringify({ tabela, codigos: bloco }),
headers: { "Content-Type": "application/json" },