fix: error when workflow id is empty
This commit is contained in:
parent
78e39ae16e
commit
d58d88c0d4
1 changed files with 5 additions and 1 deletions
|
|
@ -93,7 +93,7 @@ type ServiceUpdate = {
|
|||
*/
|
||||
installments?: number;
|
||||
status?: "ACTIVE" | "INACTIVE";
|
||||
workflowId?: string;
|
||||
workflowId?: string | null;
|
||||
work?: {
|
||||
id?: string;
|
||||
name: string;
|
||||
|
|
@ -309,6 +309,8 @@ export class ServiceController extends Controller {
|
|||
update: { value: { increment: 1 } },
|
||||
});
|
||||
|
||||
if (!!payload.workflowId) payload.workflowId = undefined;
|
||||
|
||||
return tx.service.create({
|
||||
include: {
|
||||
work: {
|
||||
|
|
@ -402,6 +404,8 @@ export class ServiceController extends Controller {
|
|||
}
|
||||
|
||||
const record = await prisma.$transaction(async (tx) => {
|
||||
if (payload.workflowId === "") payload.workflowId = undefined;
|
||||
|
||||
return await tx.service.update({
|
||||
include: {
|
||||
createdBy: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue