mirror of
https://github.com/directus/directus.git
synced 2026-01-29 00:27:59 -05:00
Use native api with access_token when defineing url as relative (#14193)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user