26 lines
1 KiB
JavaScript
26 lines
1 KiB
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.usuarios_quipo = void 0;
|
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
const p_respostas_1 = require("p-respostas");
|
|
const usuarios_quipo = async ({ token_produto, url_api_autenticacao, inquilino, }) => {
|
|
const url = `${url_api_autenticacao}/api/usuarios__listar`;
|
|
if (!token_produto)
|
|
return p_respostas_1.respostaComuns.erro("token_produto não informado");
|
|
const headers = {
|
|
token: token_produto,
|
|
"Content-Type": "application/json",
|
|
};
|
|
return (0, cross_fetch_1.default)(url, {
|
|
method: "POST",
|
|
body: JSON.stringify({ inquilino }),
|
|
headers,
|
|
})
|
|
.then((r) => r.json())
|
|
.catch((e) => p_respostas_1.respostaComuns.erro(`Erro ao buscar usuários quipo governo ${e.message}`))
|
|
.then((r) => r);
|
|
};
|
|
exports.usuarios_quipo = usuarios_quipo;
|