Skip to content

Instantly share code, notes, and snippets.

@johnsusek
Created August 26, 2020 17:10
Show Gist options
  • Save johnsusek/85f7539d08a491d81b12b2ff9f932792 to your computer and use it in GitHub Desktop.
Save johnsusek/85f7539d08a491d81b12b2ff9f932792 to your computer and use it in GitHub Desktop.
/** @module action/Zone */
// Auto-generated, edits will be overwritten
import * as Zone from '../Zone'
export default {
async search_zone({ commit }, { options }) {
const response = await Zone.search_zone(options);
if (response.error) {
commit('SEARCH_ZONE_ERROR', { response, options });
} else {
commit('SEARCH_ZONE', { response, options });
}
return response;
},
async create_zone({ commit }, { options }) {
const response = await Zone.create_zone(options);
if (response.error) {
commit('CREATE_ZONE_ERROR', { response, options });
} else {
commit('CREATE_ZONE', { response, options });
}
return response;
},
async delete_zone({ commit }, { id }) {
const response = await Zone.delete_zone(id);
if (response.error) {
commit('DELETE_ZONE_ERROR', { response, id });
} else {
commit('DELETE_ZONE', { response, id });
}
return response;
},
async get_zone({ commit }, { id }) {
const response = await Zone.get_zone(id);
if (response.error) {
commit('GET_ZONE_ERROR', { response, id });
} else {
commit('GET_ZONE', { response, id });
}
return response;
},
async update_zone({ commit }, { id, options }) {
const response = await Zone.update_zone(id, options);
if (response.error) {
commit('UPDATE_ZONE_ERROR', { response, id, options });
} else {
commit('UPDATE_ZONE', { response, id, options });
}
return response;
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment