Feat: Hooks for Summary

This commit is contained in:
Br0wnHammer committed 2025-07-01 18:10:35 +05:30
1 parent 5428999d46
commit 644de5f34a
8 files changed
+91 -38

No files matched your search

+6 -4
View File
@@ -312,12 +312,14 @@ const ackAllChecks = async (monitorId, teamId, ack, path) => {
* @returns {Promise<Object>}
* @throws {Error}
*/
const getChecksAndSummaryByTeamId = async ({ teamId }) => {
const getChecksSummaryByTeamId = async ({ teamId }) => {
try {
const matchStage = {
teamId: new ObjectId(teamId),
}
const checks = await Check.aggregate(buildChecksAndSummaryByTeamIdPipeline({ matchStage }));
};
const checks = await Check.aggregate(
buildChecksAndSummaryByTeamIdPipeline({ matchStage })
);
return checks[0].summary;
} catch (error) {
error.service = SERVICE_NAME;
@@ -409,7 +411,7 @@ export {
getChecksByTeam,
ackCheck,
ackAllChecks,
getChecksAndSummaryByTeamId,
getChecksSummaryByTeamId,
deleteChecks,
deleteChecksByTeamId,
updateChecksTTL,