Module app/services/userActiveGames.service

This is the user active games service file This file takes input from the controller and directs it to the db.service file The five functions are userActiveGamesCreateService, userActiveGamesSearchService, userActiveGamesUpdateService, puzzleRemoveService, and filterInputQuery The main purpose of this service file is to perform the 'business' logic Any errors will be caught by our try/catch block in our controller

Properties

Properties

export=: {
    createUserActiveGames: ((userActiveGames: any) => Promise<any>);
    removeUserActiveGames: ((userActiveGames: any) => Promise<any>);
    updateUserActiveGames: ((bodyData: any, queryData: any) => Promise<any>);
    userActiveGamesPuzzle: ((userActiveGames: any) => Promise<any>);
}

Type declaration

  • createUserActiveGames: ((userActiveGames: any) => Promise<any>)
      • (userActiveGames: any): Promise<any>
      • This function takes the Active Games JSON objects and sends them to the upload function There is no need for any additional logic here

        Parameters

        • userActiveGames: any

          This is an array of Active Games JSON objects puzzles

        Returns Promise<any>

  • removeUserActiveGames: ((userActiveGames: any) => Promise<any>)
      • (userActiveGames: any): Promise<any>
      • This function takes in the input query and deletes any user active games that match the query We do not throw an error here to stay aligned with standard practice. A delete request is successful even if the object did not exist.

        Parameters

        • userActiveGames: any

          this stores a JSON object that stores the query

        Returns Promise<any>

  • updateUserActiveGames: ((bodyData: any, queryData: any) => Promise<any>)
      • (bodyData: any, queryData: any): Promise<any>
      • This function takes in bodyData and queryData and updates all user active games that match the queryData with the bodyData This function calls a helper function to create the inputQuery for the database function

        Parameters

        • bodyData: any

          this stores a JSON object with values to be updated

        • queryData: any

          this stores a JSON object with values used to retrieve puzzles to be updated

        Returns Promise<any>

  • userActiveGamesPuzzle: ((userActiveGames: any) => Promise<any>)
      • (userActiveGames: any): Promise<any>
      • This function takes in the input query and throws and error if no puzzles are found to match the query This function calls a helper function to create the inputQuery for the dataBase function

        Parameters

        • userActiveGames: any

          this is a JSON object that stores the input query

        Returns Promise<any>

Generated using TypeDoc