diff --git a/api/resolvers/notifications.js b/api/resolvers/notifications.js index fe5a45112..d2fe5a28a 100644 --- a/api/resolvers/notifications.js +++ b/api/resolvers/notifications.js @@ -371,6 +371,7 @@ export default { AND t >= date_trunc('day', CURRENT_DATE - INTERVAL '2 day') AND t <= $2 GROUP BY t + HAVING sum(msats_stacked) != 0 OR sum(msats_spent) != 0 ORDER BY "sortTime" DESC LIMIT 1)` ) diff --git a/worker/satSummary.js b/worker/satSummary.js index e591c5283..0f179731f 100644 --- a/worker/satSummary.js +++ b/worker/satSummary.js @@ -8,6 +8,8 @@ export async function summarizeDailySats ({ data: { userId }, models }) { WHERE id = ${userId} AND t >= date_trunc('day', CURRENT_DATE - INTERVAL '1 day') AND t <= date_trunc('day', CURRENT_DATE) + GROUP BY id + HAVING sum(msats_stacked) != 0 OR sum(msats_spent) != 0 LIMIT 1 `