From 8ec4fa4bf49010e8a3c171f3bf9c9cb51bfa8409 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Tue, 26 Jul 2022 13:48:18 +0200 Subject: [PATCH] Allow to optionally set axios params in `urlData` --- client/src/utils/url.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/utils/url.js b/client/src/utils/url.js index ad1bca5000e..a8e4840e2ec 100644 --- a/client/src/utils/url.js +++ b/client/src/utils/url.js @@ -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);