convertido para pnpm
This commit is contained in:
parent
59e710f6cf
commit
175d767d27
115 changed files with 2366 additions and 1451 deletions
26
dist-front/lista-prefeituras.js
Normal file
26
dist-front/lista-prefeituras.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import cFetch from "cross-fetch";
|
||||
import { respostaComuns } from "p-respostas";
|
||||
const tx_listar_prefeituras = "listar_prefeituras";
|
||||
const listarPrefeituras = async ({
|
||||
url_api_autenticacao
|
||||
}) => {
|
||||
const url = `${url_api_autenticacao}/api/${tx_listar_prefeituras}`;
|
||||
return cFetch(url).then(async (a) => {
|
||||
const texto = await a.text();
|
||||
try {
|
||||
const res = JSON.parse(texto);
|
||||
return res;
|
||||
} catch (error) {
|
||||
return respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [
|
||||
texto,
|
||||
error
|
||||
]);
|
||||
}
|
||||
}).catch(
|
||||
(error) => respostaComuns.erro(`Erro ao listar cidades: ${error.message}`, [error])
|
||||
);
|
||||
};
|
||||
export {
|
||||
listarPrefeituras,
|
||||
tx_listar_prefeituras
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue