Browse Source

Retirado o hard code de fetch de dados do painel

vuejs_painel
AlGouvea 4 years ago
parent
commit
8c882e0f86
  1. 7
      frontend/src/__apps/painel/main.js

7
frontend/src/__apps/painel/main.js

@ -88,9 +88,14 @@ const v = new Vue({ // eslint-disable-line
} }
return texto return texto
}, },
converterUrl (url) {
url = url.slice(-4)
url = '/painel/' + url + '/dados'
return url
},
fetchData () { fetchData () {
// TODO: how to get no hardcoded URL? // 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.brasao = response.brasao
this.painel_aberto = response.status_painel this.painel_aberto = response.status_painel
this.sessao_finalizada = response.sessao_finalizada this.sessao_finalizada = response.sessao_finalizada

Loading…
Cancel
Save