From 8c882e0f861e8a9a90137123a1552649d30cc8f1 Mon Sep 17 00:00:00 2001 From: AlGouvea Date: Thu, 15 Jul 2021 10:56:34 -0300 Subject: [PATCH] Retirado o hard code de fetch de dados do painel --- frontend/src/__apps/painel/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/__apps/painel/main.js b/frontend/src/__apps/painel/main.js index 89e0a7a17..9c9b4633f 100644 --- a/frontend/src/__apps/painel/main.js +++ b/frontend/src/__apps/painel/main.js @@ -88,9 +88,14 @@ const v = new Vue({ // eslint-disable-line } return texto }, + converterUrl (url) { + url = url.slice(-4) + url = '/painel/' + url + '/dados' + return url + }, fetchData () { // TODO: how to get no hardcoded URL? - $.get('/painel/2867/dados', function (response) { + $.get(this.converterUrl(window.location.pathname), function (response) { this.brasao = response.brasao this.painel_aberto = response.status_painel this.sessao_finalizada = response.sessao_finalizada