Skip to content

Commit

Permalink
Remove selectedFormat parameter from server request
Browse files Browse the repository at this point in the history
Signed-off-by: shevijacobson <[email protected]>
  • Loading branch information
Shevijacobson committed Nov 4, 2024
1 parent 0f6ab82 commit 1bdf29a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions client/src/app/api/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,19 +358,11 @@ export function getTaskByIdAndFormat(
});
}

export function getTasksByIds(
ids: number[],
format: "json" | "yaml"
): Promise<Task[]> {
const isYaml = format === "yaml";
const headers = isYaml ? { ...yamlHeaders } : { ...jsonHeaders };
const responseType = isYaml ? "text" : "json";
export function getTasksByIds(ids: number[]): Promise<Task[]> {
const filterParam = `id:(${ids.join("|")})`;

return axios
.get<Task[]>(`${TASKS}`, {
headers: headers,
responseType: responseType,
params: {
filter: filterParam,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down

0 comments on commit 1bdf29a

Please sign in to comment.