padronizado url de grafico

This commit is contained in:
Luiz H. R. Silva 2024-06-25 18:42:47 -03:00
parent 78acaa0816
commit bdc72f7e38
4 changed files with 7 additions and 20 deletions

View file

@ -31,14 +31,10 @@ export const serie_consultar = (cliente) => (parametros) => {
return resp; return resp;
}); });
const url = () => { const url = () => {
const pr = {
cliente,
parametros,
};
const vUrl = new URL(`${cliente.emDesenvolvimento const vUrl = new URL(`${cliente.emDesenvolvimento
? "http://127.0.0.1:5081" ? "http://127.0.0.1:5081"
: "https://carro-de-boi.idz.one"}${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}`); : "https://carro-de-boi.idz.one"}${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}/${cliente.produto}/${cliente.conta}`);
const serie = encodeURIComponent(JSON.stringify(pr, null, 2)); const serie = encodeURIComponent(JSON.stringify(parametros, null, 2));
return `${vUrl.href}?serie=${serie}`; return `${vUrl.href}?serie=${serie}`;
}; };
return { return {

View file

@ -75,14 +75,10 @@ var serie_consultar = function (cliente) {
}); });
}); }; }); };
var url = function () { var url = function () {
var pr = {
cliente: cliente,
parametros: parametros,
};
var vUrl = new URL("".concat(cliente.emDesenvolvimento var vUrl = new URL("".concat(cliente.emDesenvolvimento
? "http://127.0.0.1:5081" ? "http://127.0.0.1:5081"
: "https://carro-de-boi.idz.one").concat(variaveis_1.PREFIXO, "/").concat(variaveis_1.tiposSeriesAgregacoes.enum.contagem)); : "https://carro-de-boi.idz.one").concat(variaveis_1.PREFIXO, "/").concat(variaveis_1.tiposSeriesAgregacoes.enum.contagem, "/").concat(cliente.produto, "/").concat(cliente.conta));
var serie = encodeURIComponent(JSON.stringify(pr, null, 2)); var serie = encodeURIComponent(JSON.stringify(parametros, null, 2));
return "".concat(vUrl.href, "?serie=").concat(serie); return "".concat(vUrl.href, "?serie=").concat(serie);
}; };
return { return {

View file

@ -1,6 +1,6 @@
{ {
"name": "p-drives", "name": "p-drives",
"version": "0.89.0", "version": "0.90.0",
"description": "", "description": "",
"main": "src/index.ts", "main": "src/index.ts",
"exports": { "exports": {

View file

@ -47,20 +47,15 @@ export const serie_consultar =
} }
const url = (): string => { const url = (): string => {
const pr = {
cliente,
parametros,
}
const vUrl = new URL( const vUrl = new URL(
`${ `${
cliente.emDesenvolvimento cliente.emDesenvolvimento
? "http://127.0.0.1:5081" ? "http://127.0.0.1:5081"
: "https://carro-de-boi.idz.one" : "https://carro-de-boi.idz.one"
}${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}`, }${PREFIXO}/${tiposSeriesAgregacoes.enum.contagem}/${cliente.produto}/${cliente.conta}`,
) )
const serie = encodeURIComponent(JSON.stringify(pr, null, 2)) const serie = encodeURIComponent(JSON.stringify(parametros, null, 2))
return `${vUrl.href}?serie=${serie}` return `${vUrl.href}?serie=${serie}`
} }