default: {
    checkIfTopicInGroupExists(
        topicGroupId: number,
        topicId: number,
    ): Promise<RowDataPacket[]>;
    insertTopicInGroup(
        topicGroupId: number,
        topicId: number,
    ): Promise<QueryResult>;
} = ...

Model for managing topics in groups.

Type declaration

  • checkIfTopicInGroupExists:function
    • Checks if a topic is already in a group.

      Parameters

      • topicGroupId: number

        The ID of the topic group.

      • topicId: number

        The ID of the topic.

      Returns Promise<RowDataPacket[]>

      A promise that resolves to the existing topic in the group, if any.

  • insertTopicInGroup:function
    • Inserts a topic into a group.

      Parameters

      • topicGroupId: number

        The ID of the topic group.

      • topicId: number

        The ID of the topic.

      Returns Promise<QueryResult>

      A promise that resolves when the insertion is complete.