feat: allow user to specify true or false cancel
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
This commit is contained in:
parent
cfe820b89f
commit
e76abd787c
1 changed files with 6 additions and 6 deletions
|
|
@ -784,7 +784,7 @@ export class LineController extends Controller {
|
||||||
async customerRequestCancel(
|
async customerRequestCancel(
|
||||||
@Path() requestDataId: string,
|
@Path() requestDataId: string,
|
||||||
@Request() req: RequestWithLineUser,
|
@Request() req: RequestWithLineUser,
|
||||||
@Body() body: { reason: string },
|
@Body() body: { cancel: boolean; reason?: string },
|
||||||
) {
|
) {
|
||||||
const result = await prisma.requestData.updateMany({
|
const result = await prisma.requestData.updateMany({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -803,8 +803,8 @@ export class LineController extends Controller {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
customerRequestCancel: true,
|
customerRequestCancel: body.cancel,
|
||||||
customerRequestCancelReason: body.reason,
|
customerRequestCancelReason: body.reason || "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (result.count <= 0) throw notFoundError("Request Data");
|
if (result.count <= 0) throw notFoundError("Request Data");
|
||||||
|
|
@ -815,7 +815,7 @@ export class LineController extends Controller {
|
||||||
async customerRequestCancelWork(
|
async customerRequestCancelWork(
|
||||||
@Path() requestWorkId: string,
|
@Path() requestWorkId: string,
|
||||||
@Request() req: RequestWithLineUser,
|
@Request() req: RequestWithLineUser,
|
||||||
@Body() body: { reason: string },
|
@Body() body: { cancel: boolean; reason?: string },
|
||||||
) {
|
) {
|
||||||
const result = await prisma.requestWork.updateMany({
|
const result = await prisma.requestWork.updateMany({
|
||||||
where: {
|
where: {
|
||||||
|
|
@ -836,8 +836,8 @@ export class LineController extends Controller {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
customerRequestCancel: true,
|
customerRequestCancel: body.cancel,
|
||||||
customerRequestCancelReason: body.reason,
|
customerRequestCancelReason: body.reason || "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
if (result.count <= 0) throw notFoundError("Request Data");
|
if (result.count <= 0) throw notFoundError("Request Data");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue