fix: typo and error
This commit is contained in:
parent
66aa3b1641
commit
42ff57e23e
1 changed files with 5 additions and 6 deletions
|
|
@ -301,7 +301,7 @@ export class RequestListController extends Controller {
|
||||||
@Path() step: number,
|
@Path() step: number,
|
||||||
@Body()
|
@Body()
|
||||||
payload: {
|
payload: {
|
||||||
requestWorkStatus?: RequestWorkStatus;
|
workStatus?: RequestWorkStatus;
|
||||||
attributes?: Record<string, any>;
|
attributes?: Record<string, any>;
|
||||||
customerDuty?: boolean;
|
customerDuty?: boolean;
|
||||||
customerDutyCost?: number;
|
customerDutyCost?: number;
|
||||||
|
|
@ -314,6 +314,8 @@ export class RequestListController extends Controller {
|
||||||
},
|
},
|
||||||
@Query() successAll?: boolean,
|
@Query() successAll?: boolean,
|
||||||
) {
|
) {
|
||||||
|
if (!payload.responsibleUserId) payload.responsibleUserId = undefined;
|
||||||
|
|
||||||
const record = await prisma.requestWorkStepStatus.upsert({
|
const record = await prisma.requestWorkStepStatus.upsert({
|
||||||
include: {
|
include: {
|
||||||
requestWork: true,
|
requestWork: true,
|
||||||
|
|
@ -332,7 +334,7 @@ export class RequestListController extends Controller {
|
||||||
update: payload,
|
update: payload,
|
||||||
});
|
});
|
||||||
|
|
||||||
switch (payload.requestWorkStatus) {
|
switch (payload.workStatus) {
|
||||||
case "InProgress":
|
case "InProgress":
|
||||||
case "Waiting":
|
case "Waiting":
|
||||||
case "Validate":
|
case "Validate":
|
||||||
|
|
@ -347,10 +349,7 @@ export class RequestListController extends Controller {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (successAll && (payload.workStatus === "Completed" || payload.workStatus === "Ended")) {
|
||||||
successAll &&
|
|
||||||
(payload.requestWorkStatus === "Completed" || payload.requestWorkStatus === "Ended")
|
|
||||||
) {
|
|
||||||
await prisma.requestData.update({
|
await prisma.requestData.update({
|
||||||
where: {
|
where: {
|
||||||
id: record.requestWork.requestDataId,
|
id: record.requestWork.requestDataId,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue