Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. set(this, 'config', { operacoes: A([]) });
  2.  
  3. get(this, 'httpService')
  4. .get(Routes.build('urlConfig'))
  5. .then((response) => {
  6.  
  7. const {
  8. diaMesAtual,
  9. mesesVendas,
  10. operacoes,
  11. mediaVendasDiasUteis,
  12. mediaVendasSabado
  13. } = response;
  14.  
  15. set(this, 'operacoes', operacoes);
  16.  
  17. set(this, 'config', {
  18. diaMesAtual,
  19. mesesVendas,
  20. mediaVendasDiasUteis,
  21. mediaVendasSabado,
  22. operacoes: operacoes.map(({ descricao, sigla }) => {
  23. return { label: descricao, value: sigla };
  24. }),
  25. });
  26.  
  27. set(this, 'bindingOperacoes', get(this, 'operacoes')
  28. .filter(({ marcado }) => marcado)
  29. .map(({ sigla }) => sigla));
  30.  
  31. })
  32. .catch((err) => {
  33. this.handleRequestError(err);
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement