lrf402788946 4 năm trước cách đây
mục cha
commit
47f66627f9

+ 38 - 0
src/store/achieve/achieve_apply_expert.js

@@ -0,0 +1,38 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import _ from 'lodash';
+Vue.use(Vuex);
+const api = {
+  interface: `/api/achieve/v0/achieveApplyExpert`,
+};
+const state = () => ({});
+const mutations = {};
+
+const actions = {
+  async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+    const res = await this.$axios.$get(api.interface, { skip, limit, ...info });
+    return res;
+  },
+  async create({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}`, payload);
+    return res;
+  },
+  async fetch({ commit }, payload) {
+    const res = await this.$axios.$get(`${api.interface}/${payload}`);
+    return res;
+  },
+  async update({ commit }, { id, ...info } = {}) {
+    const res = await this.$axios.$post(`${api.interface}/update/${id}`, { ...info });
+    return res;
+  },
+  async delete({ commit }, payload) {
+    const res = await this.$axios.$delete(`${api.interface}/${payload}`);
+    return res;
+  },
+};
+export default {
+  namespaced: true,
+  state,
+  mutations,
+  actions,
+};

+ 5 - 1
src/store/achieve/achieve_expert.js

@@ -10,7 +10,7 @@ const state = () => ({});
 const mutations = {};
 
 const actions = {
-  async query({ commit }, { skip = 0, limit = 10, ...info } = {}) {
+  async query({ commit }, { skip = 0, limit = 0, ...info } = {}) {
     const res = await this.$axios.$get(api.interface, { skip, limit, ...info });
     return res;
   },
@@ -30,6 +30,10 @@ const actions = {
     const res = await this.$axios.$delete(`${api.interface}/${payload}`);
     return res;
   },
+  async restore({ commit }, payload) {
+    const res = await this.$axios.$post(`${api.interface}/restore/${payload}`);
+    return res;
+  },
   async login({ commit }, payload) {
     const res = await this.$axios.$post(`${api.interface}/login`, payload);
     if (res.errcode === 0) {