From 80c540a8d29605cde106c6eaa36ef88976ee0851 Mon Sep 17 00:00:00 2001 From: Donald Wu Date: Wed, 4 Jan 2023 23:47:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20remove=20status=20in=20up?= =?UTF-8?q?dateIncidentById=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../incident/dto/updateIncidentById.dto.ts | 3 +- apps/api/src/incident/incident.repository.ts | 2 - .../incidentDetail/IncidentDetail.tsx | 65 ++++++++----------- apps/web/src/services/incidentService.ts | 4 +- 4 files changed, 30 insertions(+), 44 deletions(-) diff --git a/apps/api/src/incident/dto/updateIncidentById.dto.ts b/apps/api/src/incident/dto/updateIncidentById.dto.ts index 38294fc..70c1c5f 100644 --- a/apps/api/src/incident/dto/updateIncidentById.dto.ts +++ b/apps/api/src/incident/dto/updateIncidentById.dto.ts @@ -1,8 +1,7 @@ -import { IncidentType, Status } from '@prisma/client'; +import { IncidentType } from '@prisma/client'; export class UpdateIncidentByIdDto { title: string; description: string; incidentType: IncidentType; - status: Status; } diff --git a/apps/api/src/incident/incident.repository.ts b/apps/api/src/incident/incident.repository.ts index 2131ac9..be3b6b5 100644 --- a/apps/api/src/incident/incident.repository.ts +++ b/apps/api/src/incident/incident.repository.ts @@ -269,7 +269,6 @@ export class IncidentRepository { const title = updateIncidentByIdDto.title; const description = updateIncidentByIdDto.description; const incidentType = updateIncidentByIdDto.incidentType; - const status = updateIncidentByIdDto.status; const incident = await this.prisma.incident.update({ where: { @@ -279,7 +278,6 @@ export class IncidentRepository { title: title, description: description, type: incidentType, - status: status, }, include: { creator: { diff --git a/apps/web/src/components/incidentDetail/IncidentDetail.tsx b/apps/web/src/components/incidentDetail/IncidentDetail.tsx index ef17b19..ee44058 100644 --- a/apps/web/src/components/incidentDetail/IncidentDetail.tsx +++ b/apps/web/src/components/incidentDetail/IncidentDetail.tsx @@ -73,10 +73,6 @@ function IncidentDetail() { setIncidentType(event.target.value as IncidentType); }; - const handleStatusChange = (event: SelectChangeEvent) => { - setStatus(event.target.value as Status); - }; - const handleUpdateIncidentClick = async () => { const token = localStorage.getItem('token'); if (token && incident) { @@ -85,8 +81,7 @@ function IncidentDetail() { incident.id, title, description, - incidentType, - status + incidentType ); if (response) { const responseData = response.data; @@ -155,24 +150,18 @@ function IncidentDetail() { -
- - - Status - - - +
+
- +
+ +