• Is public topic message validator

    Parameters

    • notificationService: NotificationDataService

      injected service use to handle the notification related operations

      • getOneMessage
      • getOneTopic
    • targetField: TargetField

      which field to get the message id from

    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query].

    Returns Promise<number>

    200 Status OK

    Description

    This validator checks if the topic is public by applying the following steps in sequence:

    1. Get message by id (notificationService.getOneMessage)

    2. Check if the message exists

    3. Get topic by id (notificationService.getOneTopic)

    4. Check if the topic exists

    5. Check if the topic is public

    Throws

    404 NBError Not Found

    • message not found
    • topic not found

    Throws

    403 NBError Forbidden

    • topic is not public

Generated using TypeDoc