mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2026-01-03 19:44:55 +01:00
Merge branch 'main' into parent-location-sync
This commit is contained in:
@@ -148,9 +148,7 @@ describe("user should be able to create an item and add an attachment", () => {
|
||||
{
|
||||
const { response, data } = await api.items.maintenance.getLog(item.id);
|
||||
expect(response.status).toBe(200);
|
||||
expect(data.entries).toHaveLength(maintenanceEntries.length);
|
||||
expect(data.costAverage).toBeGreaterThan(0);
|
||||
expect(data.costTotal).toBeGreaterThan(0);
|
||||
expect(data).toHaveLength(maintenanceEntries.length);
|
||||
}
|
||||
|
||||
cleanup();
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
MaintenanceEntryCreate,
|
||||
MaintenanceEntryWithDetails,
|
||||
} from "../types/data-contracts";
|
||||
import type { AttachmentTypes, PaginationResult } from "../types/non-generated";
|
||||
import type { AttachmentTypes, ItemSummaryPaginationResult } from "../types/non-generated";
|
||||
import type { MaintenanceFilters } from "./maintenance.ts";
|
||||
import type { Requests } from "~~/lib/requests";
|
||||
|
||||
@@ -98,7 +98,7 @@ export class ItemsApi extends BaseAPI {
|
||||
}
|
||||
|
||||
getAll(q: ItemsQuery = {}) {
|
||||
return this.http.get<PaginationResult<ItemSummary>>({ url: route("/items", q) });
|
||||
return this.http.get<ItemSummaryPaginationResult<ItemSummary>>({ url: route("/items", q) });
|
||||
}
|
||||
|
||||
create(item: ItemCreate) {
|
||||
|
||||
@@ -16,3 +16,7 @@ export interface PaginationResult<T> {
|
||||
pageSize: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface ItemSummaryPaginationResult<T> extends PaginationResult<T> {
|
||||
totalPrice: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user