build
This commit is contained in:
parent
f2562a37d1
commit
7032eb1329
39 changed files with 442 additions and 790 deletions
|
|
@ -1,19 +1,10 @@
|
|||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
import { respostaComuns } from "p-respostas";
|
||||
import { urlAutenticacao } from "./_urlAutenticacao";
|
||||
import node_fetch from "cross-fetch";
|
||||
export const codigoContaSite = (_a) => __awaiter(void 0, [_a], void 0, function* ({ ambiente, post, }) {
|
||||
export const codigoContaSite = async ({ ambiente, post, }) => {
|
||||
const url = `${urlAutenticacao(ambiente)}/api/codigo_prefeitura_site`;
|
||||
try {
|
||||
const resp = yield node_fetch(url, {
|
||||
const resp = await node_fetch(url, {
|
||||
method: "POST",
|
||||
body: JSON.stringify(post),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
|
@ -26,4 +17,4 @@ export const codigoContaSite = (_a) => __awaiter(void 0, [_a], void 0, function*
|
|||
catch (e) {
|
||||
return respostaComuns.erro(`erro ao buscar código do site: ${e}`);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue