From 875857f118d0364a94eb88bf03673e1d0165c23c Mon Sep 17 00:00:00 2001 From: transtrike Date: Thu, 17 Dec 2020 19:42:45 +0200 Subject: Fixed namespaces --- src/DevHive.Web/Controllers/RoleController.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/DevHive.Web/Controllers/RoleController.cs') diff --git a/src/DevHive.Web/Controllers/RoleController.cs b/src/DevHive.Web/Controllers/RoleController.cs index 1664f4f..fc05481 100644 --- a/src/DevHive.Web/Controllers/RoleController.cs +++ b/src/DevHive.Web/Controllers/RoleController.cs @@ -4,13 +4,12 @@ using DevHive.Services.Services; using Microsoft.AspNetCore.Mvc; using DevHive.Web.Models.Identity.Role; using AutoMapper; -using DevHive.Services.Models.Identity.Role; using System; -using Microsoft.AspNetCore.Authorization; +using DevHive.Common.Models.Identity; namespace DevHive.Web.Controllers { - [ApiController] + [ApiController] [Route("/api/[controller]")] //[Authorize(Roles = "Admin")] public class RoleController @@ -25,10 +24,10 @@ namespace DevHive.Web.Controllers } [HttpPost] - public async Task Create([FromBody] CreateRoleWebModel createRoleWebModel) + public async Task Create([FromBody] CreateRoleModel createRoleModel) { - RoleServiceModel roleServiceModel = - this._roleMapper.Map(createRoleWebModel); + RoleModel roleServiceModel = + this._roleMapper.Map(createRoleModel); bool result = await this._roleService.CreateRole(roleServiceModel); @@ -41,17 +40,17 @@ namespace DevHive.Web.Controllers [HttpGet] public async Task GetById(Guid id) { - RoleServiceModel roleServiceModel = await this._roleService.GetRoleById(id); - RoleWebModel roleWebModel = this._roleMapper.Map(roleServiceModel); + RoleModel roleServiceModel = await this._roleService.GetRoleById(id); + RoleModel roleWebModel = this._roleMapper.Map(roleServiceModel); return new OkObjectResult(roleWebModel); } [HttpPut] - public async Task Update(Guid id, [FromBody] UpdateRoleWebModel updateRoleWebModel) + public async Task Update(Guid id, [FromBody] UpdateRoleModel updateRoleModel) { - RoleServiceModel roleServiceModel = - this._roleMapper.Map(updateRoleWebModel); + RoleModel roleServiceModel = + this._roleMapper.Map(updateRoleModel); roleServiceModel.Id = id; bool result = await this._roleService.UpdateRole(roleServiceModel); -- cgit v1.2.3