You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

termsConditions.js 790B

1234567891011121314151617181920212223242526272829303132
  1. /* eslint-disable */
  2. import axios from "axios";
  3. export default {
  4. namespaced: true,
  5. state: {
  6. terms: []
  7. },
  8. mutations: {
  9. getTermsAndConditions: (state, fee) => (state.terms = fee),
  10. newTermsAndConditions: (state, fee) => (state.terms = fee)
  11. },
  12. getters: {
  13. getTermsAndConditions: state => state.terms
  14. },
  15. actions: {
  16. async retrieveTerms({ commit }) {
  17. await axios.get("api/tc/").then(res => {
  18. commit("getTermsAndConditions", res.data);
  19. });
  20. },
  21. async setTerms({ commit }, terms) {
  22. const response = await axios.post("api/tc/", terms);
  23. if (response.status === 200) {
  24. commit("newTermsAndConditions", response.data);
  25. return Promise.resolve();
  26. } else {
  27. return Promise.reject();
  28. }
  29. }
  30. }
  31. };