• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hicommonwealth / commonwealth / 16680327260

01 Aug 2025 04:36PM UTC coverage: 38.352% (-0.02%) from 38.376%
16680327260

push

github

web-flow
Merge pull request #12697 from hicommonwealth/tim/topic-subscriptions

1861 of 5228 branches covered (35.6%)

Branch coverage included in aggregate %.

3 of 27 new or added lines in 8 files covered. (11.11%)

3297 of 8221 relevant lines covered (40.1%)

35.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/model/src/aggregates/subscription/GetSubscribableTopics.query.ts
1
import { type Query } from '@hicommonwealth/core';
2
import * as schemas from '@hicommonwealth/schemas';
3
import { QueryTypes } from 'sequelize';
4
import { models } from '../../database';
5

6
export function GetSubscribableTopics(): Query<
7
  typeof schemas.GetSubscribableTopics
8
> {
NEW
9
  return {
×
10
    ...schemas.GetSubscribableTopics,
11
    auth: [],
12
    secure: true,
13
    body: async ({ actor }) => {
NEW
14
      return await models.sequelize.query<{
×
15
        id: number;
16
        name: string;
17
        community_id: string;
18
      }>(
19
        `
20
            SELECT T.id, T.name, T.community_id
21
            FROM "Topics" T
22
            JOIN "Addresses" A ON T.community_id = A.community_id
23
            LEFT JOIN "TopicSubscriptions" TS ON T.id = TS.topic_id
24
            WHERE T.deleted_at IS NULL AND A.user_id = :user_id AND TS.user_id IS NULL
25
            GROUP BY T.id, T.name, T.community_id;
26
        `,
27
        {
28
          replacements: { user_id: actor.user.id },
29
          type: QueryTypes.SELECT,
30
          raw: true,
31
        },
32
      );
33
    },
34
  };
35
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc