diff --git a/client/src/api/remoteFiles.ts b/client/src/api/remoteFiles.ts index ae9a86cd3ffe..942e295c5dc6 100644 --- a/client/src/api/remoteFiles.ts +++ b/client/src/api/remoteFiles.ts @@ -28,15 +28,15 @@ export interface FilterFileSourcesOptions { exclude?: FileSourcePluginKind[]; } -const getRemoteFilesPlugins = fetcher.path("/api/remote_files/plugins").method("get").create(); +const remoteFilesPluginsFetcher = fetcher.path("/api/remote_files/plugins").method("get").create(); /** * Get the list of available file sources from the server that can be browsed. * @param options The options to filter the file sources. * @returns The list of available (browsable) file sources from the server. */ -export async function getFileSources(options: FilterFileSourcesOptions = {}): Promise { - const { data } = await getRemoteFilesPlugins({ +export async function fetchFileSources(options: FilterFileSourcesOptions = {}): Promise { + const { data } = await remoteFilesPluginsFetcher({ browsable_only: true, include_kind: options.include, exclude_kind: options.exclude, diff --git a/client/src/components/FilesDialog/FilesDialog.vue b/client/src/components/FilesDialog/FilesDialog.vue index aafcd559aac2..e18d3013e837 100644 --- a/client/src/components/FilesDialog/FilesDialog.vue +++ b/client/src/components/FilesDialog/FilesDialog.vue @@ -4,9 +4,9 @@ import Vue, { computed, onMounted, ref } from "vue"; import { browseRemoteFiles, + fetchFileSources, FileSourceBrowsingMode, FilterFileSourcesOptions, - getFileSources, RemoteEntry, } from "@/api/remoteFiles"; import { UrlTracker } from "@/components/DataDialog/utilities"; @@ -231,7 +231,7 @@ function load(record?: SelectionItem) { undoShow.value = !urlTracker.value.atRoot(); if (urlTracker.value.atRoot() || errorMessage.value) { errorMessage.value = undefined; - getFileSources(props.filterOptions) + fetchFileSources(props.filterOptions) .then((results) => { const convertedItems = results .filter((item) => !props.requireWritable || item.writable) diff --git a/client/src/components/HistoryImport.vue b/client/src/components/HistoryImport.vue index ff889d829399..9522706527d5 100644 --- a/client/src/components/HistoryImport.vue +++ b/client/src/components/HistoryImport.vue @@ -88,7 +88,7 @@ import { getAppRoot } from "onload/loadConfig"; import { errorMessageAsString } from "utils/simple-error"; import Vue, { ref, watch } from "vue"; -import { getFileSources } from "@/api/remoteFiles"; +import { fetchFileSources } from "@/api/remoteFiles"; import ExternalLink from "./ExternalLink"; @@ -163,7 +163,7 @@ export default { }, methods: { async initialize() { - const fileSources = await getFileSources(); + const fileSources = await fetchFileSources(); this.hasFileSources = fileSources.length > 0; this.initializing = false; },