Module UserGameStatisticsController

This is the controller file for the puzzle endpoint This file is called by the router file and calls the service file There are four main functions createUserGameStatistics, searchUserGameStatistics, updateUserGameStatistics, and removeUserGameStatistics The main purpose of the controller is to make sure that only validated and sanitized data moves on to the service function

Properties

Properties

export=: {
    create: ((req: any, res: any, next: any) => Promise<void>);
    remove: ((req: any, res: any, next: any) => Promise<void>);
    search: ((req: any, res: any, next: any) => Promise<void>);
    update: ((req: any, res: any, next: any) => Promise<void>);
}

Type declaration

  • create: ((req: any, res: any, next: any) => Promise<void>)
      • (req: any, res: any, next: any): Promise<void>
      • Returns 201 if userActiveGameService is successful Otherwise catches error and sends to our errorHandler Takes sanitized input and sends it to userActiveGamesService

        Parameters

        • req: any

          This is the request object

        • res: any

          This is the response object

        • next: any

          This takes us to the errorHandler if request fails

        Returns Promise<void>

  • remove: ((req: any, res: any, next: any) => Promise<void>)
      • (req: any, res: any, next: any): Promise<void>
      • Returns 200 if userGameStatisticsService is successful Otherwise catches error and sends to our errorHandler Takes sanitized input and sends it to userGameStatisticsService

        Parameters

        • req: any

          This is the request object

        • res: any

          This is the response object

        • next: any

          This takes us to the errorHandler if request fails

        Returns Promise<void>

  • search: ((req: any, res: any, next: any) => Promise<void>)
      • (req: any, res: any, next: any): Promise<void>
      • Returns 200 if userActiveGameService is successful Otherwise catches error and sends to our errorHandler Takes sanitized input and sends it to userActiveGamesService

        Parameters

        • req: any

          This is the request object

        • res: any

          This is the response object

        • next: any

          This takes us to the errorHandler if request fails

        Returns Promise<void>

  • update: ((req: any, res: any, next: any) => Promise<void>)
      • (req: any, res: any, next: any): Promise<void>
      • Returns 200 if userActiveGamesService is successful Otherwise catches error and sends to our errorHandler Takes sanitized input and sends it to userActiveGamesService

        Parameters

        • req: any

          This is the request object

        • res: any

          This is the response object

        • next: any

          This takes us to the errorHandler if request fails

        Returns Promise<void>

Generated using TypeDoc