data.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. export const state = () => ({
  2. buyerAccount: {
  3. fetching: false,
  4. data: []
  5. },
  6. buyerRecord: {
  7. fetching: false,
  8. data: []
  9. },
  10. vendorAccount: {
  11. fetching: false,
  12. data: []
  13. },
  14. vendorRecord: {
  15. fetching: false,
  16. data: []
  17. }
  18. })
  19. export const mutations = {
  20. REQUEST_BUYER_ACCOUNT (state) {
  21. state.buyerAccount.fetching = true
  22. },
  23. GET_BUYER_ACCOUNT_FAILURE (state) {
  24. state.buyerAccount.fetching = false
  25. },
  26. GET_BUYER_ACCOUNT_SUCCESS (state, result) {
  27. state.buyerAccount.fetching = false
  28. state.buyerAccount.data = result
  29. },
  30. REQUEST_BUYER_RECORD (state) {
  31. state.buyerRecord.fetching = true
  32. },
  33. GET_BUYER_RECORD_FAILURE (state) {
  34. state.buyerRecord.fetching = false
  35. },
  36. GET_BUYER_RECORD_SUCCESS (state, result) {
  37. state.buyerRecord.fetching = false
  38. state.buyerRecord.data = result
  39. },
  40. REQUEST_VENDOR_ACCOUNT (state) {
  41. state.vendorAccount.fetching = true
  42. },
  43. GET_VENDOR_ACCOUNT_FAILURE (state) {
  44. state.vendorAccount.fetching = false
  45. },
  46. GET_VENDOR_ACCOUNT_SUCCESS (state, result) {
  47. state.vendorAccount.fetching = false
  48. state.vendorAccount.data = result
  49. },
  50. REQUEST_VENDOR_RECORD (state) {
  51. state.vendorRecord.fetching = true
  52. },
  53. GET_VENDOR_RECORD_FAILURE (state) {
  54. state.vendorRecord.fetching = false
  55. },
  56. GET_VENDOR_RECORD_SUCCESS (state, result) {
  57. state.vendorRecord.fetching = false
  58. state.vendorRecord.data = result
  59. }
  60. }