mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Allow to optionally set axios params in urlData
This commit is contained in:
@@ -2,11 +2,12 @@ import axios from "axios";
|
||||
import { getAppRoot } from "onload/loadConfig";
|
||||
import { rethrowSimple } from "utils/simple-error";
|
||||
|
||||
export async function urlData({ url, headers }) {
|
||||
export async function urlData({ url, headers, params }) {
|
||||
try {
|
||||
console.debug("Requesting data from: ", url);
|
||||
headers = headers || {};
|
||||
const { data } = await axios.get(`${getAppRoot()}${url}`, { headers });
|
||||
params = params || {};
|
||||
const { data } = await axios.get(`${getAppRoot()}${url}`, { headers, params });
|
||||
return data;
|
||||
} catch (e) {
|
||||
rethrowSimple(e);
|
||||
|
||||
Reference in New Issue
Block a user