ajuste na funcao de node_fetch

This commit is contained in:
MarcioJRGodoi 2024-06-25 08:54:43 -03:00
parent 059780f4c4
commit 84e3b9d377
4 changed files with 37 additions and 30 deletions

View file

@ -16,17 +16,17 @@ export const usuarios_quipo_vincular = ({ token_produto, ambiente, conta, vincul
return respostaComuns.erro("token_produto não informado");
const headers = {
token: token_produto,
"Content-Type": "application/json",
};
const parametros = {
vinculos: { codigo_conta: conta, codigo_usuario, vinculo },
email: email,
};
return node_fetch(url, {
return yield node_fetch(url, {
headers,
body: JSON.stringify(parametros),
method: "POST",
})
.then((r) => String(r))
.catch((e) => respostaComuns.erro(`Erro ao criar vinculo de usuario ${e.message}`))
.then((r) => r);
.then((r) => __awaiter(void 0, void 0, void 0, function* () { return yield r.json(); }))
.catch((e) => respostaComuns.erro(`Erro ao criar vinculo de usuario ${e.message}`));
});