fix(frontend): logout state not shown after JWT expires (#40)
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

Reviewed-on: #40
This commit was merged in pull request #40.
This commit is contained in:
2026-09-06 23:26:07 +01:00
parent 6fa02a34a3
commit 9758bb296b
12 changed files with 131 additions and 147 deletions

View File

@@ -1,15 +1,16 @@
import type { APIResponse, JobResponse } from "../types.ts";
import { API_URL } from "./client.ts";
import { API_URL, apiFetch, apiFetchRaw } from "./client.ts";
const getJob = async (uuid: string): Promise<JobResponse> => {
const response = await fetch(API_URL + `/api/v1/jobs/${uuid}`, { credentials: 'include' });
if (!response.ok) throw new Error(`Failed to fetch job: ${response.status}`);
const result: APIResponse = await response.json();
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;
};
export { getJob };
const downloadJob = async (uuid: string): Promise<Blob> => {
const response = await apiFetchRaw(API_URL + `/api/v1/jobs/${uuid}/download`);
return response.blob();
};
export { getJob, downloadJob };