How to use the inversify-express-utils.httpPut function in inversify-express-utils

To help you get started, we’ve selected a few inversify-express-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github preram48 / sonarr-trakt-tv / src / api / controllers / ListController.ts View on Github external
return this.listService.findAll();
    }

    @httpPost('/')
    public async create( @response() res: Response, @requestBody() body: any): Promise {
        await this.listService.create(body);
        return {};
    }

    @httpDelete('/:id')
    public async destroy( @response() res: Response, @requestParam('id') id: string): Promise {
        await this.listService.delete(id);
        return {};
    }

    @httpPut('/:id')
    public async update( @response() res: Response, @requestParam('id') id: string, @requestBody() body: any): Promise {
        await this.listService.update(id, body);
        return {};
    }
}
github preram48 / sonarr-trakt-tv / src / api / controllers / SettingsController.ts View on Github external
}

    @httpPost('/')
    public async create( @response() res: Response, @requestBody() body: any): Promise {
        await this.settingsService.create(body);
        this.syncRunnerService.setupSyncList();
        return {};
    }

    @httpDelete('/:id')
    public async destroy( @response() res: Response, @requestParam('id') id: string): Promise {
        await this.settingsService.delete(id);
        return {};
    }

    @httpPut('/:id')
    public async update( @response() res: Response, @requestParam('id') id: string, @requestBody() body: any): Promise {
        await this.settingsService.update(id, body);
        this.syncRunnerService.setupSyncList();
        return {};
    }
}
github mkryuk / node-step-by-step / src / controllers / todo.controller.ts View on Github external
return res.json({ todo });
      })
      .catch(next);
  }

  @httpDelete('/:id', authMiddlware.bearerStrategy)
  public removeTodo(req: IRequest, res: Response, next: NextFunction) {
    const id = req.params.id;
    return this._todoService.removeTodo(id, req.user.id)
      .then((todo) => {
        return res.json({ todo });
      })
      .catch(next);
  }

  @httpPut('/:id', authMiddlware.bearerStrategy)
  public changeComplete(req: IRequest, res: Response, next: NextFunction) {
    const id = req.params.id;
    return this._todoService.changeComplete(id, req.user.id, req.body.completed)
      .then((todo) => {
        return res.json({ todo });
      })
      .catch(next);
  }
}