💚 Fix isFirstOfKind filter
This commit is contained in:
@@ -52,7 +52,7 @@ export const sendTotalResultsDigest = async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const resultsWithWorkspaces = results
|
const resultsWithWorkspaces = results
|
||||||
.flatMap((result, resultIndex) => {
|
.flatMap((result) => {
|
||||||
const workspace = workspaces.find((workspace) =>
|
const workspace = workspaces.find((workspace) =>
|
||||||
workspace.typebots.some((typebot) => typebot.id === result.typebotId)
|
workspace.typebots.some((typebot) => typebot.id === result.typebotId)
|
||||||
)
|
)
|
||||||
@@ -64,10 +64,7 @@ export const sendTotalResultsDigest = async () => {
|
|||||||
workspaceId: workspace.id,
|
workspaceId: workspace.id,
|
||||||
typebotId: result.typebotId,
|
typebotId: result.typebotId,
|
||||||
totalResultsYesterday: result._count._all,
|
totalResultsYesterday: result._count._all,
|
||||||
isFirstOfKind:
|
isFirstOfKind: memberIndex === 0 ? (true as const) : undefined,
|
||||||
resultIndex === 0 && memberIndex === 0
|
|
||||||
? (true as const)
|
|
||||||
: undefined,
|
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
.filter(isDefined)
|
.filter(isDefined)
|
||||||
|
|||||||
Reference in New Issue
Block a user