fix: duplicate on edit

This commit is contained in:
Methapon2001 2024-12-16 10:50:14 +07:00
parent 5fb4692746
commit 780fa4cb55

View file

@ -390,7 +390,12 @@ export class TaskController extends Controller {
),
),
createMany: {
data: body.taskList,
data: body.taskList.filter(
(lhs) =>
!record?.taskList.find(
(rhs) => lhs.requestWorkId === rhs.requestWorkId && lhs.step === rhs.step,
),
),
skipDuplicates: true,
},
},