Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "lib/request-handlers/devices"

Index

Functions

Const getDeviceById

  • getDeviceById(_request: Request<ParamsDictionary, any, any, ParsedQs>, response: Response<any>): Promise<void>
  • specalized function to get device by its id. This function depends on lib/middlewares/deviceCheck to have been called and added the device to response.locals TODO: [DATAHUB-83] Test if response.locals.device really exists if not throw 500 internal error

    Parameters

    • _request: Request<ParamsDictionary, any, any, ParsedQs>
    • response: Response<any>

    Returns Promise<void>

Const getDevices

  • getDevices(_request: Request<ParamsDictionary, any, any, ParsedQs>, response: Response<any>): Promise<void>
  • Use prisma to GET all devices

    Parameters

    • _request: Request<ParamsDictionary, any, any, ParsedQs>
    • response: Response<any>

    Returns Promise<void>

Const getDevicesFromProject

  • getDevicesFromProject(request: Request<ParamsDictionary, any, any, ParsedQs>, response: Response<any>): Promise<void>
  • Gets all devices that are part of a project depends on lib/middlewares/projectCheck

    Parameters

    • request: Request<ParamsDictionary, any, any, ParsedQs>
    • response: Response<any>

    Returns Promise<void>

Const postDevice

  • postDevice(request: Request<ParamsDictionary, any, any, ParsedQs>, response: Response<any>): Promise<void>
  • Use prisma to POST a new device

    Parameters

    • request: Request<ParamsDictionary, any, any, ParsedQs>
    • response: Response<any>

    Returns Promise<void>

Generated using TypeDoc