Skip to content

Commit

Permalink
Add DateCreated and DateUpdated to userTasks job
Browse files Browse the repository at this point in the history
Can we please handle this on the db/orm level?
  • Loading branch information
FyreByrd committed Oct 18, 2024
1 parent c311ec3 commit 2b83b40
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export class Modify extends ScriptoriaJobExecutor<BullMQ.ScriptoriaJobType.UserT
.map((t) => t[0].meta.user) as RoleId[]
).filter((r) => job.data.operation.by !== 'Role' || job.data.operation.roles.includes(r));
job.updateProgress(40 + ((i + 0.33) * 40) / products.length);
const timestamp = new Date();
createdTasks = Array.from(
new Set(
Array.from(allUsers.entries())
Expand All @@ -140,7 +141,9 @@ export class Modify extends ScriptoriaJobExecutor<BullMQ.ScriptoriaJobType.UserT
ProductId: product.Id,
ActivityName: snap.value,
Status: snap.value,
Comment: job.data.comment
Comment: job.data.comment,
DateCreated: timestamp,
DateUpdated: timestamp
}));
await DatabaseWrites.userTasks.createMany({
data: createdTasks
Expand Down

0 comments on commit 2b83b40

Please sign in to comment.