implemented pagination, header polish, and new display fixes

This commit is contained in:
2025-12-15 20:28:14 -05:00
parent fd94a5f261
commit 1eef9145a4
16 changed files with 370 additions and 18 deletions

View File

@@ -1,4 +1,5 @@
import { LOARequest, LOAType } from '@shared/types/loa'
import { PagedData } from '@shared/types/pagination'
// @ts-ignore
const addr = import.meta.env.VITE_APIHOST;
@@ -58,8 +59,18 @@ export async function getMyLOA(): Promise<LOARequest | null> {
}
}
export function getAllLOAs(): Promise<LOARequest[]> {
return fetch(`${addr}/loa/all`, {
export async function getAllLOAs(page?: number, pageSize?: number): Promise<PagedData<LOARequest>> {
const params = new URLSearchParams();
if (page !== undefined) {
params.set("page", page.toString());
}
if (pageSize !== undefined) {
params.set("pageSize", pageSize.toString());
}
return fetch(`${addr}/loa/all?${params}`, {
method: "GET",
headers: {
"Content-Type": "application/json",