Skip to content

Commit 569cecb

Browse files
authored
The email counts should come from the completed bulk action… not this iteration (#2271)
1 parent c0b6c41 commit 569cecb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export class BulkActionService extends BaseService {
274274
});
275275

276276
// 4. Update the bulk action group
277-
await this._prisma.bulkActionGroup.update({
277+
const updatedGroup = await this._prisma.bulkActionGroup.update({
278278
where: { id: bulkActionId },
279279
data: {
280280
cursor: runIdsToProcess.at(runIdsToProcess.length - 1),
@@ -323,9 +323,9 @@ export class BulkActionService extends BaseService {
323323
friendlyId: group.friendlyId,
324324
}
325325
)}`,
326-
totalCount: successCount + failureCount,
327-
successCount,
328-
failureCount,
326+
totalCount: updatedGroup.totalCount,
327+
successCount: updatedGroup.successCount,
328+
failureCount: updatedGroup.failureCount,
329329
type: group.type,
330330
createdAt: formatDateTime(group.createdAt, "UTC", [], true, true),
331331
completedAt: formatDateTime(group.completedAt ?? new Date(), "UTC", [], true, true),

0 commit comments

Comments
 (0)