gardens.js 963 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. export const state = () => ({
  2. gardenType: {
  3. fetching: false,
  4. data: []
  5. },
  6. detail: {
  7. fetching: false,
  8. data: []
  9. },
  10. list: {
  11. fetching: false,
  12. data: []
  13. }
  14. })
  15. export const mutations = {
  16. REQUEST_GARDENTYPE (state) {
  17. state.gardenType.fetching = true
  18. },
  19. GET_GARDENTYPE_SUCCESS (state, result) {
  20. state.gardenType.fetching = false
  21. state.gardenType.data = result
  22. },
  23. GET_GARDENTYPE_FAILURE (state) {
  24. state.gardenType.fetching = false
  25. },
  26. REQUEST_DETAIL (state) {
  27. state.detail.fetching = true
  28. },
  29. GET_DETAIL_SUCCESS (state, result) {
  30. state.detail.fetchiong = false
  31. state.detail.data = result
  32. },
  33. GET_DETAIL_FAILURE (state) {
  34. state.detail.fetching = false
  35. },
  36. REQUEST_LIST (state) {
  37. state.list.fetching = true
  38. },
  39. GET_LIST_SUCCESS (state, result) {
  40. state.list.fetching = false
  41. state.list.data = result
  42. },
  43. GET_LIST_FAILURE (state) {
  44. state.list.fetching = false
  45. }
  46. }