diff --git a/cypress.json b/cypress.json index 470c720..acac844 100644 --- a/cypress.json +++ b/cypress.json @@ -1,3 +1,4 @@ { + "baseUrl": "http://localhost:8080", "pluginsFile": "tests/e2e/plugins/index.js" -} +} \ No newline at end of file diff --git a/src/actions.js b/src/actions.js index b6e42bb..0d8a6fd 100644 --- a/src/actions.js +++ b/src/actions.js @@ -3,38 +3,38 @@ axios.defaults.headers["Cache-Control"] = "no-cache"; axios.defaults.baseURL = "https://api-test.gestionix.com/api/v3"; export default { - async login(context) { - const { data } = await axios({ - method: "post", - url: "/users/authentication", - data: { - user: "qa@gestionix.com", - password: "gestionix" - } - }); + async login() { + const { data } = await axios({ + method: "post", + url: "/users/authentication", + data: { + user: "qa@gestionix.com", + password: "gestionix" + } + }); - const { access_token, user_id } = data; + const { access_token } = data; - axios.defaults.headers.common["Authorization"] = `Bearer ${access_token}`; + axios.defaults.headers.common["Authorization"] = `Bearer ${access_token}`; - return true; - }, - async getCompanies({ commit, state }) { - console.log("Dispatching action"); + return true; + }, + async getCompanies({ commit }) { + // console.log("Dispatching action"); - const { data } = await axios.get("/users/companies"); + const { data } = await axios.get("/users/companies"); - commit("setCompanies", data); + commit("setCompanies", data); - return true; - }, - async getBranches({ commit, state }, companyId) { - commit('selectCompany', companyId); - const { data } = await axios.get("/branch_offices", { - headers: { - Company: companyId - } - }); - commit("setBranches", data); - } -} \ No newline at end of file + return true; + }, + async getBranches({ commit }, companyId) { + commit("selectCompany", companyId); + const { data } = await axios.get("/branch_offices", { + headers: { + Company: companyId + } + }); + commit("setBranches", data); + } +}; diff --git a/src/components/CompanyBranch.vue b/src/components/CompanyBranch.vue index 21b2760..68db944 100644 --- a/src/components/CompanyBranch.vue +++ b/src/components/CompanyBranch.vue @@ -1,16 +1,17 @@