simplify/factorize backend for maintenance

This commit is contained in:
Maximilien Carbonne
2024-09-22 19:12:06 +02:00
parent 17ecfa2c66
commit ca85d4b483
10 changed files with 103 additions and 172 deletions

View File

@@ -136,7 +136,7 @@
}
async function complete(maintenanceEntry: MaintenanceEntry) {
const { error } = await api.maintenances.update(maintenanceEntry.id, {
const { error } = await api.maintenance.update(maintenanceEntry.id, {
name: maintenanceEntry.name,
completedDate: new Date(Date.now()),
scheduledDate: maintenanceEntry.scheduledDate ?? "null",
@@ -144,7 +144,7 @@
cost: maintenanceEntry.cost,
});
if (error) {
toast.error(t("maintenances.toast.failed_to_update"));
toast.error(t("maintenance.toast.failed_to_update"));
}
emit("changed");
}