mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2025-05-18 20:38:14 +08:00
Fixed table rendering being broken when there are too many records and added logs pages
This commit is contained in:
parent
1c595b3b03
commit
23a743ce2b
8 changed files with 435 additions and 4 deletions
|
@ -13,6 +13,8 @@ import {
|
|||
EquipmentInstanceType,
|
||||
PatchEquipmentInstanceType,
|
||||
PatchEquipmentType,
|
||||
EquipmentLogListType,
|
||||
EquipmentInstanceLogListType,
|
||||
} from "../Types/Types";
|
||||
|
||||
const debug = false;
|
||||
|
@ -246,8 +248,31 @@ export async function EquipmentCreateAPI(equipment: AddEquipmentType) {
|
|||
});
|
||||
}
|
||||
|
||||
export async function EquipmentLogsAPI() {
|
||||
const config = await GetConfig();
|
||||
return instance
|
||||
.get("api/v1/equipments/equipments/logs", config)
|
||||
.then((response) => {
|
||||
return response.data as EquipmentLogListType;
|
||||
})
|
||||
.catch(() => {
|
||||
console.log("Error retrieving equipment logs");
|
||||
});
|
||||
}
|
||||
|
||||
// Equipment Instances APIs
|
||||
|
||||
export async function EquipmentInstanceLogsAPI() {
|
||||
const config = await GetConfig();
|
||||
return instance
|
||||
.get("api/v1/equipments/equipment_instances/logs", config)
|
||||
.then((response) => {
|
||||
return response.data as EquipmentInstanceLogListType;
|
||||
})
|
||||
.catch(() => {
|
||||
console.log("Error retrieving equipment logs");
|
||||
});
|
||||
}
|
||||
export async function EquipmentInstanceAPI(id: number) {
|
||||
const config = await GetConfig();
|
||||
return instance
|
||||
|
|
|
@ -46,6 +46,18 @@ export type EquipmentType = {
|
|||
|
||||
export type EquipmentListType = Array<EquipmentType>;
|
||||
|
||||
export type EquipmentLogType = {
|
||||
history_id: number;
|
||||
id: number;
|
||||
name: string;
|
||||
category: string;
|
||||
description: string;
|
||||
history_date: string;
|
||||
history_user: string;
|
||||
};
|
||||
|
||||
export type EquipmentLogListType = Array<EquipmentLogType>;
|
||||
|
||||
export type AddEquipmentInstanceType = {
|
||||
equipment: number;
|
||||
status: string;
|
||||
|
@ -70,3 +82,17 @@ export type EquipmentInstanceType = {
|
|||
};
|
||||
|
||||
export type EquipmentInstanceListType = Array<EquipmentInstanceType>;
|
||||
|
||||
export type EquipmentInstanceLogType = {
|
||||
history_id: number;
|
||||
id: number;
|
||||
equipment: number;
|
||||
equipment_name: string;
|
||||
category: string;
|
||||
status: string;
|
||||
remarks: string;
|
||||
history_date: string;
|
||||
history_user: string;
|
||||
};
|
||||
|
||||
export type EquipmentInstanceLogListType = Array<EquipmentInstanceLogType>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue