drivers/dist-import/autenticacao/_usuarios_quipo.js
2024-12-02 11:10:53 -03:00

19 lines
708 B
JavaScript

import node_fetch from "cross-fetch";
import { respostaComuns } from "p-respostas";
import { urlAutenticacao } from "./_urlAutenticacao";
export const usuarios_quipo = async ({ token_produto, ambiente, tipo, }) => {
const url = `${urlAutenticacao(ambiente)}/api/usuarios_quipo`;
if (!token_produto)
return respostaComuns.erro("token_produto não informado");
const headers = {
token: token_produto,
};
return node_fetch(url, {
method: "POST",
body: JSON.stringify({ tipo }),
headers,
})
.then((r) => r.json())
.catch((e) => respostaComuns.erro(`Erro ao buscar usuários quipo governo ${e.message}`))
.then((r) => r);
};