This commit is contained in:
parent
1a6a19574d
commit
676bd1d16d
1 changed files with 15 additions and 2 deletions
|
|
@ -269,7 +269,7 @@ export class RequestDataActionController extends Controller {
|
||||||
return result[0];
|
return result[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post("request-work/${requestWorkId}/reject-request-cancel")
|
@Post("request-work/{requestWorkId}/reject-request-cancel")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
async rejectWorkRequestCancel(
|
async rejectWorkRequestCancel(
|
||||||
@Request() req: RequestWithUser,
|
@Request() req: RequestWithUser,
|
||||||
|
|
@ -303,7 +303,20 @@ export class RequestDataActionController extends Controller {
|
||||||
|
|
||||||
@Post("cancel")
|
@Post("cancel")
|
||||||
@Security("keycloak")
|
@Security("keycloak")
|
||||||
async cancelRequestData(@Path() requestDataId: string) {
|
async cancelRequestData(@Request() req: RequestWithUser, @Path() requestDataId: string) {
|
||||||
|
const result = await prisma.requestData.findFirst({
|
||||||
|
where: {
|
||||||
|
id: requestDataId,
|
||||||
|
quotation: {
|
||||||
|
registeredBranch: {
|
||||||
|
OR: permissionCond(req.user),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result) throw notFoundError("Request Data");
|
||||||
|
|
||||||
await prisma.$transaction(async (tx) => {
|
await prisma.$transaction(async (tx) => {
|
||||||
const workStepCondition = {
|
const workStepCondition = {
|
||||||
requestWork: { requestDataId },
|
requestWork: { requestDataId },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue