Feat: Hooks for Summary
This commit is contained in:
1 parent
5428999d46
commit
644de5f34a
8 files changed
+91
-38
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user