implemented pagination, header polish, and new display fixes
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user