edit repairs
This commit is contained in:
parent
c79d5bb1cd
commit
789272dc37
9 changed files with 201 additions and 74 deletions
|
@ -2,6 +2,7 @@ import { defineStore } from "pinia";
|
|||
import type {
|
||||
CreateRepairViewModel,
|
||||
RepairViewModel,
|
||||
UpdateRepairStatusViewModel,
|
||||
UpdateRepairViewModel,
|
||||
} from "@/viewmodels/admin/unit/repair.models";
|
||||
import { http } from "@/serverCom";
|
||||
|
@ -110,9 +111,22 @@ export const useRepairStore = defineStore("repair", {
|
|||
return result;
|
||||
},
|
||||
async updateRepair(repair: UpdateRepairViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/repair/${repair.id}`, {
|
||||
const result = await http.patch(`/admin/repair/${this.activeRepairObj?.id}`, {
|
||||
title: repair.title,
|
||||
description: repair.description,
|
||||
responsible: repair.responsible,
|
||||
});
|
||||
return result;
|
||||
},
|
||||
async updateRepairReports(reports: Array<string>): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/repair/${this.activeRepairObj?.id}/reports`, {
|
||||
reports,
|
||||
});
|
||||
return result;
|
||||
},
|
||||
async updateRepairStatus(repair: UpdateRepairStatusViewModel): Promise<AxiosResponse<any, any>> {
|
||||
const result = await http.patch(`/admin/repair/${this.activeRepairObj?.id}/status`, {
|
||||
status: repair.status,
|
||||
noteByWorker: repair.noteByWorker,
|
||||
done: repair.done,
|
||||
});
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue