import axios from "axios";

const baseUrl = location.origin;
const endPoint = `${baseUrl}/api/v1/plans`;
const headers = {
  "Content-type": "application/json",
  Authorization: window.gobiertoAPI.token
};

// Plans-endpoint factory to get/post/put/delete API data
export const PlansFactoryMixin = {
  locale: I18n.locale,
  methods: {
    getPlan(id, params) {
      const qs = new URLSearchParams({ locale: this.$options.locale, ...params })
      return axios.get(`${endPoint}/${id}?${qs.toString()}`, { headers })
    },
    getProjects(id, params) {
      const qs = new URLSearchParams({ locale: this.$options.locale, ...params })
      return axios.get(`${endPoint}/${id}/projects?${qs.toString()}`, { headers })
    },
    getMeta(id, params) {
      const qs = new URLSearchParams({ locale: this.$options.locale, ...params })
      return axios.get(`${endPoint}/${id}/meta?${qs.toString()}`, { headers })
    }
  }
};

@@ -98,16 +98,172 @@
 plans%60;%0A
+const token = window.gobiertoAPI.token.length == 0 && window.gobiertoAPI.basic_auth_token ? window.gobiertoAPI.basic_auth_token : window.gobiertoAPI.token%0A%0A
 const he
@@ -327,35 +327,16 @@
 zation: 
-window.gobiertoAPI.
 token%0A%7D;

Include basic_auth_token in gobierto plans factories header