From 1bdf29a2b78ea3ca586f15d6aac1c4d20d3b47ac Mon Sep 17 00:00:00 2001 From: shevijacobson Date: Thu, 31 Oct 2024 09:16:04 +0200 Subject: [PATCH] Remove selectedFormat parameter from server request Signed-off-by: shevijacobson --- client/src/app/api/rest.ts | 10 +--------- .../applications-table/applications-table.tsx | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/client/src/app/api/rest.ts b/client/src/app/api/rest.ts index a054969a3..b145ceda8 100644 --- a/client/src/app/api/rest.ts +++ b/client/src/app/api/rest.ts @@ -358,19 +358,11 @@ export function getTaskByIdAndFormat( }); } -export function getTasksByIds( - ids: number[], - format: "json" | "yaml" -): Promise { - const isYaml = format === "yaml"; - const headers = isYaml ? { ...yamlHeaders } : { ...jsonHeaders }; - const responseType = isYaml ? "text" : "json"; +export function getTasksByIds(ids: number[]): Promise { const filterParam = `id:(${ids.join("|")})`; return axios .get(`${TASKS}`, { - headers: headers, - responseType: responseType, params: { filter: filterParam, }, diff --git a/client/src/app/pages/applications/applications-table/applications-table.tsx b/client/src/app/pages/applications/applications-table/applications-table.tsx index 62dc041e6..cf32e536c 100644 --- a/client/src/app/pages/applications/applications-table/applications-table.tsx +++ b/client/src/app/pages/applications/applications-table/applications-table.tsx @@ -212,7 +212,7 @@ export const ApplicationsTable: React.FC = () => { .filter((id): id is number => typeof id === "number"); try { - const tasks = await getTasksByIds(ids, selectedFormat); + const tasks = await getTasksByIds(ids); const data = selectedFormat === "yaml" ? yaml.dump(tasks, { indent: 2 })