Use native api with access_token when defineing url as relative (#14193)

This commit is contained in:
Gerard Lamusse
2022-06-29 20:42:23 +02:00
committed by GitHub
parent 7a7540ddaa
commit de9dc8ac4f

View File

@@ -33,6 +33,7 @@ import { defineComponent, ref, PropType } from 'vue';
import axios from 'axios';
import { throttle, get, debounce } from 'lodash';
import { render } from 'micromustache';
import api from '@/api';
export default defineComponent({
props: {
@@ -100,7 +101,7 @@ export default defineComponent({
const url = render(props.url, { value });
try {
const result = await axios.get(url);
const result = await (url.startsWith('/') ? api.get(url) : axios.get(url));
const resultsArray = props.resultsPath ? get(result.data, props.resultsPath) : result.data;
if (Array.isArray(resultsArray) === false) {