fix (#199)
This commit is contained in:
1 parent
a895db751f
commit
060165b449
1 file changed
+3
-2
@@ -205,6 +205,7 @@ export async function parseSesHook(data: SesEvent) {
|
||||
updateField === "delivered"
|
||||
) {
|
||||
logger.info("Updating cumulated metrics");
|
||||
const cumulatedField = isHardBounced ? "hardBounced" : updateField;
|
||||
await db.cumulatedMetrics.upsert({
|
||||
where: {
|
||||
teamId_domainId: {
|
||||
@@ -213,14 +214,14 @@ export async function parseSesHook(data: SesEvent) {
|
||||
},
|
||||
},
|
||||
update: {
|
||||
[updateField]: {
|
||||
[cumulatedField]: {
|
||||
increment: BigInt(1),
|
||||
},
|
||||
},
|
||||
create: {
|
||||
teamId: email.teamId,
|
||||
domainId: email.domainId ?? 0,
|
||||
[updateField]: BigInt(1),
|
||||
[cumulatedField]: BigInt(1),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user