diff options
Diffstat (limited to 'src/DevHive.Web/Controllers')
| -rw-r--r-- | src/DevHive.Web/Controllers/LanguageController.cs | 13 | ||||
| -rw-r--r-- | src/DevHive.Web/Controllers/TechnologyController.cs | 12 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/DevHive.Web/Controllers/LanguageController.cs b/src/DevHive.Web/Controllers/LanguageController.cs index 486e16e..5e1a9a7 100644 --- a/src/DevHive.Web/Controllers/LanguageController.cs +++ b/src/DevHive.Web/Controllers/LanguageController.cs @@ -36,21 +36,20 @@ namespace DevHive.Web.Controllers } [HttpGet] - public async Task<IActionResult> GetById(Guid id) + public async Task<IActionResult> GetById(Guid languageId) { - LanguageServiceModel languageServiceModel = await this._languageService.GetLanguageById(id); + LanguageServiceModel languageServiceModel = await this._languageService.GetLanguageById(languageId); LanguageWebModel languageWebModel = this._languageMapper.Map<LanguageWebModel>(languageServiceModel); return new OkObjectResult(languageWebModel); } [HttpPut] - public async Task<IActionResult> Update(Guid id, [FromBody] UpdateLanguageWebModel updateModel) + public async Task<IActionResult> Update(Guid languageId, [FromBody] UpdateLanguageWebModel updateModel) { UpdateLanguageServiceModel updatelanguageServiceModel = this._languageMapper.Map<UpdateLanguageServiceModel>(updateModel); - updatelanguageServiceModel.Id = id; - bool result = await this._languageService.UpdateLanguage(updatelanguageServiceModel); + bool result = await this._languageService.UpdateLanguage(languageId, updatelanguageServiceModel); if (!result) return new BadRequestObjectResult("Could not update Language"); @@ -59,9 +58,9 @@ namespace DevHive.Web.Controllers } [HttpDelete] - public async Task<IActionResult> Delete(Guid id) + public async Task<IActionResult> Delete(Guid languageId) { - bool result = await this._languageService.DeleteLanguage(id); + bool result = await this._languageService.DeleteLanguage(languageId); if (!result) return new BadRequestObjectResult("Could not delete Language"); diff --git a/src/DevHive.Web/Controllers/TechnologyController.cs b/src/DevHive.Web/Controllers/TechnologyController.cs index 905a71d..964bafc 100644 --- a/src/DevHive.Web/Controllers/TechnologyController.cs +++ b/src/DevHive.Web/Controllers/TechnologyController.cs @@ -36,20 +36,20 @@ namespace DevHive.Web.Controllers } [HttpGet] - public async Task<IActionResult> GetById(Guid id) + public async Task<IActionResult> GetById(Guid technologyId) { - TechnologyServiceModel technologyServiceModel = await this._technologyService.GetTechnologyById(id); + TechnologyServiceModel technologyServiceModel = await this._technologyService.GetTechnologyById(technologyId); TechnologyWebModel technologyWebModel = this._technologyMapper.Map<TechnologyWebModel>(technologyServiceModel); return new OkObjectResult(technologyWebModel); } [HttpPut] - public async Task<IActionResult> Update(Guid id, [FromBody] UpdateTechnologyWebModel updateModel) + public async Task<IActionResult> Update(Guid technologyId, [FromBody] UpdateTechnologyWebModel updateModel) { UpdateTechnologyServiceModel updateTechnologyWebModel = this._technologyMapper.Map<UpdateTechnologyServiceModel>(updateModel); - bool result = await this._technologyService.UpdateTechnology(updateTechnologyWebModel); + bool result = await this._technologyService.UpdateTechnology(technologyId, updateTechnologyWebModel); if (!result) return new BadRequestObjectResult("Could not update Technology"); @@ -58,9 +58,9 @@ namespace DevHive.Web.Controllers } [HttpDelete] - public async Task<IActionResult> Delete(Guid id) + public async Task<IActionResult> Delete(Guid technologyId) { - bool result = await this._technologyService.DeleteTechnology(id); + bool result = await this._technologyService.DeleteTechnology(technologyId); if (!result) return new BadRequestObjectResult("Could not delete Technology"); |
