build
This commit is contained in:
parent
f2562a37d1
commit
7032eb1329
39 changed files with 442 additions and 790 deletions
|
|
@ -1,16 +1,7 @@
|
|||
// npm run build produz um arquivo abrirNps.js que é copiado para a pasta public
|
||||
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";
|
||||
// exibe o iframe em tela cheia
|
||||
export const abrirNps = (emDesenvolvimento) => (parametros) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
export const abrirNps = (emDesenvolvimento) => async (parametros) => {
|
||||
const base_site = emDesenvolvimento
|
||||
? "http://localhost:5040/nps"
|
||||
: "https://carro-de-boi.idz.one/nps";
|
||||
|
|
@ -23,7 +14,7 @@ export const abrirNps = (emDesenvolvimento) => (parametros) => __awaiter(void 0,
|
|||
for (const [chave, valor] of Object.entries(parametros)) {
|
||||
url_proxima_avaliacao.searchParams.append(chave, valor);
|
||||
}
|
||||
const response = yield fetch(url_proxima_avaliacao.href)
|
||||
const response = await fetch(url_proxima_avaliacao.href)
|
||||
.then((resposta) => resposta.json())
|
||||
.catch((error) => respostaComuns.erro(error.message));
|
||||
const proxima_avaliacao = response.valor;
|
||||
|
|
@ -56,4 +47,4 @@ export const abrirNps = (emDesenvolvimento) => (parametros) => __awaiter(void 0,
|
|||
document.body.removeChild(iframe);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue