genkid2020

Untitled

Aug 26th, 2020
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. if (type === 'products') {
  2. type = products;
  3. store.dispatch(Actions.getProducts());
  4. store.dispatch(setToolbarTitle('Товары'));
  5. setCurrentType('1');
  6. setTableTitle('Список товаров');
  7. } else if (type === 'materials') {
  8. type=products;
  9. store.dispatch(Actions.getMaterialTypes());
  10. store.dispatch(setToolbarTitle('Материалы'));
  11. setCurrentType('2');
  12. setTableTitle('Список материалов');
  13. } else if (type === 'metals') {
  14. type=products;
  15. store.dispatch(Actions.getMetalTypes());
  16. store.dispatch(setToolbarTitle('Металл'));
  17. setCurrentType('3');
  18. setTableTitle('Список металлов');
  19. } else if (type === 'furniture') {
  20. type=products;
  21. store.dispatch(Actions.getFurnitureTypes());
  22. store.dispatch(setToolbarTitle('Фурнитура'));
  23. setCurrentType('4');
  24. setTableTitle('Список фурнитуры');
  25. } else if (type === 'paint') {
  26. type=products;
  27. store.dispatch(Actions.getPaintTypes());
  28. store.dispatch(setToolbarTitle('Краска'));
  29. setCurrentType('5');
  30. setTableTitle('Список красок');
  31. } else if (type === 'details') {
  32. store.dispatch(Actions.getDetailTypes());
  33. store.dispatch(setToolbarTitle('Готовая продукция'));
  34. setCurrentType('6');
  35. setTableTitle('Список готовой продукции');
  36. }
  37. }, []);
  38.  
  39. const productsList = useSelector(({ projects }) => projects.type);
Advertisement
Add Comment
Please, Sign In to add comment