Files
vod-system/frontend/src/utils/api/jobs.ts
Dylan De Faoite 9758bb296b
All checks were successful
CI / Maven unit tests (push) Successful in 14s
CI / Build and push images (push) Successful in 57s
CI / Deploy to server (push) Successful in 8s
fix(frontend): logout state not shown after JWT expires (#40)
Reviewed-on: #40
2026-09-06 23:26:07 +01:00

17 lines
600 B
TypeScript

import type { APIResponse, JobResponse } from "../types.ts";
import { API_URL, apiFetch, apiFetchRaw } from "./client.ts";
const getJob = async (uuid: string): Promise<JobResponse> => {
const result = await apiFetch<APIResponse>(API_URL + `/api/v1/jobs/${uuid}`);
if (result.status === 'error') throw new Error(`Failed to fetch job: ${result.message}`);
return result.data;
};
const downloadJob = async (uuid: string): Promise<Blob> => {
const response = await apiFetchRaw(API_URL + `/api/v1/jobs/${uuid}/download`);
return response.blob();
};
export { getJob, downloadJob };