connect to backend

This commit is contained in:
Julian Krauser 2025-06-04 14:30:41 +02:00
parent 6c8d57a7e5
commit ddeac1aa26
41 changed files with 221 additions and 291 deletions

View file

@ -14,17 +14,11 @@ export const useEquipmentDamageReportStore = defineStore("equipmentDamageReport"
actions: {
fetchDamageReportForEquipment(offset = 0, count = 25, search = "", clear = false) {
const equipmentId = useEquipmentStore().activeEquipment;
this.damageReports = damageReportDemoData
.filter((drdd) => drdd.relatedId == equipmentId)
.map((e, i) => ({ ...e, tab_pos: i }));
this.totalCount = this.damageReports.length;
this.loading = "fetched";
return;
if (clear) this.damageReports = [];
this.loading = "loading";
http
.get(
`/admin/equipment/${equipmentId}/damageReport?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
`/admin/damagereport/equipment/${equipmentId}?offset=${offset}&count=${count}${search != "" ? "&search=" + search : ""}`
)
.then((result) => {
this.totalCount = result.data.total;