diff --git a/frontend/components/Maintenance/ListView.vue b/frontend/components/Maintenance/ListView.vue new file mode 100644 index 00000000..2a9e2304 --- /dev/null +++ b/frontend/components/Maintenance/ListView.vue @@ -0,0 +1,204 @@ + + + diff --git a/frontend/lib/api/classes/items.ts b/frontend/lib/api/classes/items.ts index b5491376..dde6cc5b 100644 --- a/frontend/lib/api/classes/items.ts +++ b/frontend/lib/api/classes/items.ts @@ -10,9 +10,9 @@ import type { ItemUpdate, MaintenanceEntry, MaintenanceEntryCreate, - MaintenanceLog, } from "../types/data-contracts"; import type { AttachmentTypes, PaginationResult } from "../types/non-generated"; +import type { MaintenanceFilters } from "./maintenance.ts"; import type { Requests } from "~~/lib/requests"; export type ItemsQuery = { @@ -65,14 +65,11 @@ export class FieldsAPI extends BaseAPI { } } -type MaintenanceEntryQuery = { - scheduled?: boolean; - completed?: boolean; -}; - export class ItemMaintenanceAPI extends BaseAPI { - getLog(itemId: string, q: MaintenanceEntryQuery = {}) { - return this.http.get({ url: route(`/items/${itemId}/maintenance`, q) }); + getLog(itemId: string, filters: MaintenanceFilters = {}) { + return this.http.get({ + url: route(`/items/${itemId}/maintenance`, { status: filters.status?.toString() }), + }); } create(itemId: string, data: MaintenanceEntryCreate) { diff --git a/frontend/pages/item/[id]/index/maintenance.vue b/frontend/pages/item/[id]/index/maintenance.vue index 29172293..21088852 100644 --- a/frontend/pages/item/[id]/index/maintenance.vue +++ b/frontend/pages/item/[id]/index/maintenance.vue @@ -1,158 +1,13 @@ diff --git a/frontend/pages/maintenance.vue b/frontend/pages/maintenance.vue index f566402f..4d98c95a 100644 --- a/frontend/pages/maintenance.vue +++ b/frontend/pages/maintenance.vue @@ -1,154 +1,10 @@ - +