diff --git a/src/controllers/09-line-controller.ts b/src/controllers/09-line-controller.ts index 4e4910d..019d942 100644 --- a/src/controllers/09-line-controller.ts +++ b/src/controllers/09-line-controller.ts @@ -784,7 +784,7 @@ export class LineController extends Controller { async customerRequestCancel( @Path() requestDataId: string, @Request() req: RequestWithLineUser, - @Body() body: { reason: string }, + @Body() body: { cancel: boolean; reason?: string }, ) { const result = await prisma.requestData.updateMany({ where: { @@ -803,8 +803,8 @@ export class LineController extends Controller { }, }, data: { - customerRequestCancel: true, - customerRequestCancelReason: body.reason, + customerRequestCancel: body.cancel, + customerRequestCancelReason: body.reason || "", }, }); if (result.count <= 0) throw notFoundError("Request Data"); @@ -815,7 +815,7 @@ export class LineController extends Controller { async customerRequestCancelWork( @Path() requestWorkId: string, @Request() req: RequestWithLineUser, - @Body() body: { reason: string }, + @Body() body: { cancel: boolean; reason?: string }, ) { const result = await prisma.requestWork.updateMany({ where: { @@ -836,8 +836,8 @@ export class LineController extends Controller { }, }, data: { - customerRequestCancel: true, - customerRequestCancelReason: body.reason, + customerRequestCancel: body.cancel, + customerRequestCancelReason: body.reason || "", }, }); if (result.count <= 0) throw notFoundError("Request Data");