aboutsummaryrefslogtreecommitdiff
path: root/src/DevHive.Web/Controllers
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-01-13 23:06:18 +0200
committertranstrike <transtrike@gmail.com>2021-01-13 23:06:18 +0200
commit61c51944844ed404cd4f174440d6e81b2a8591ba (patch)
tree52384addf959a81d63d91702399f47e07bf02ded /src/DevHive.Web/Controllers
parent623bb66183be1349325ca9364f5bbf2e451f7578 (diff)
downloadDevHive-61c51944844ed404cd4f174440d6e81b2a8591ba.tar
DevHive-61c51944844ed404cd4f174440d6e81b2a8591ba.tar.gz
DevHive-61c51944844ed404cd4f174440d6e81b2a8591ba.zip
Fixed sln-wide code formatting
Diffstat (limited to 'src/DevHive.Web/Controllers')
-rw-r--r--src/DevHive.Web/Controllers/ErrorController.cs2
-rw-r--r--src/DevHive.Web/Controllers/LanguageController.cs12
-rw-r--r--src/DevHive.Web/Controllers/PostController.cs12
-rw-r--r--src/DevHive.Web/Controllers/RoleController.cs8
-rw-r--r--src/DevHive.Web/Controllers/TechnologyController.cs12
-rw-r--r--src/DevHive.Web/Controllers/UserController.cs6
6 files changed, 26 insertions, 26 deletions
diff --git a/src/DevHive.Web/Controllers/ErrorController.cs b/src/DevHive.Web/Controllers/ErrorController.cs
index c3f1e55..b187501 100644
--- a/src/DevHive.Web/Controllers/ErrorController.cs
+++ b/src/DevHive.Web/Controllers/ErrorController.cs
@@ -19,7 +19,7 @@ namespace DevHive.Web.Controllers
IExceptionHandlerFeature exception =
HttpContext.Features.Get<IExceptionHandlerFeature>();
-
+
object result = ProcessException(requestId, exception);
return new BadRequestObjectResult(JsonConvert.SerializeObject(result));
}
diff --git a/src/DevHive.Web/Controllers/LanguageController.cs b/src/DevHive.Web/Controllers/LanguageController.cs
index 29c1e99..486e16e 100644
--- a/src/DevHive.Web/Controllers/LanguageController.cs
+++ b/src/DevHive.Web/Controllers/LanguageController.cs
@@ -29,7 +29,7 @@ namespace DevHive.Web.Controllers
bool result = await this._languageService.CreateLanguage(languageServiceModel);
- if(!result)
+ if (!result)
return new BadRequestObjectResult("Could not create Language");
return new OkResult();
@@ -52,21 +52,21 @@ namespace DevHive.Web.Controllers
bool result = await this._languageService.UpdateLanguage(updatelanguageServiceModel);
- if(!result)
+ if (!result)
return new BadRequestObjectResult("Could not update Language");
return new OkResult();
}
-
+
[HttpDelete]
public async Task<IActionResult> Delete(Guid id)
{
bool result = await this._languageService.DeleteLanguage(id);
-
- if(!result)
+
+ if (!result)
return new BadRequestObjectResult("Could not delete Language");
return new OkResult();
}
}
-} \ No newline at end of file
+}
diff --git a/src/DevHive.Web/Controllers/PostController.cs b/src/DevHive.Web/Controllers/PostController.cs
index 753897c..a906e47 100644
--- a/src/DevHive.Web/Controllers/PostController.cs
+++ b/src/DevHive.Web/Controllers/PostController.cs
@@ -30,9 +30,9 @@ namespace DevHive.Web.Controllers
[HttpPost]
public async Task<IActionResult> Create([FromBody] CreatePostWebModel createPostModel)
{
- CreatePostServiceModel postServiceModel =
- this._postMapper.Map<CreatePostServiceModel>(createPostModel);
-
+ CreatePostServiceModel postServiceModel =
+ this._postMapper.Map<CreatePostServiceModel>(createPostModel);
+
bool result = await this._postService.CreatePost(postServiceModel);
if (!result)
@@ -49,7 +49,7 @@ namespace DevHive.Web.Controllers
bool result = await this._postService.AddComment(createCommentServiceModel);
- if(!result)
+ if (!result)
return new BadRequestObjectResult("Could not create the Comment");
return new OkResult();
@@ -81,7 +81,7 @@ namespace DevHive.Web.Controllers
[HttpPut]
public async Task<IActionResult> Update(Guid id, [FromBody] UpdatePostWebModel updatePostModel)
{
- UpdatePostServiceModel postServiceModel =
+ UpdatePostServiceModel postServiceModel =
this._postMapper.Map<UpdatePostServiceModel>(updatePostModel);
postServiceModel.IssuerId = id;
@@ -129,7 +129,7 @@ namespace DevHive.Web.Controllers
{
if (!await this._postService.ValidateJwtForComment(id, authorization))
return new UnauthorizedResult();
-
+
bool result = await this._postService.DeleteComment(id);
if (!result)
diff --git a/src/DevHive.Web/Controllers/RoleController.cs b/src/DevHive.Web/Controllers/RoleController.cs
index d710f5a..0a8f7a1 100644
--- a/src/DevHive.Web/Controllers/RoleController.cs
+++ b/src/DevHive.Web/Controllers/RoleController.cs
@@ -26,9 +26,9 @@ namespace DevHive.Web.Controllers
[HttpPost]
public async Task<IActionResult> Create([FromBody] CreateRoleModel createRoleModel)
{
- RoleModel roleServiceModel =
- this._roleMapper.Map<RoleModel>(createRoleModel);
-
+ RoleModel roleServiceModel =
+ this._roleMapper.Map<RoleModel>(createRoleModel);
+
bool result = await this._roleService.CreateRole(roleServiceModel);
if (!result)
@@ -49,7 +49,7 @@ namespace DevHive.Web.Controllers
[HttpPut]
public async Task<IActionResult> Update(Guid id, [FromBody] UpdateRoleModel updateRoleModel)
{
- RoleModel roleServiceModel =
+ RoleModel roleServiceModel =
this._roleMapper.Map<RoleModel>(updateRoleModel);
roleServiceModel.Id = id;
diff --git a/src/DevHive.Web/Controllers/TechnologyController.cs b/src/DevHive.Web/Controllers/TechnologyController.cs
index e02ca3d..905a71d 100644
--- a/src/DevHive.Web/Controllers/TechnologyController.cs
+++ b/src/DevHive.Web/Controllers/TechnologyController.cs
@@ -29,7 +29,7 @@ namespace DevHive.Web.Controllers
bool result = await this._technologyService.Create(technologyServiceModel);
- if(!result)
+ if (!result)
return new BadRequestObjectResult("Could not create the Technology");
return new OkResult();
@@ -51,21 +51,21 @@ namespace DevHive.Web.Controllers
bool result = await this._technologyService.UpdateTechnology(updateTechnologyWebModel);
- if(!result)
+ if (!result)
return new BadRequestObjectResult("Could not update Technology");
return new OkResult();
}
-
+
[HttpDelete]
public async Task<IActionResult> Delete(Guid id)
{
bool result = await this._technologyService.DeleteTechnology(id);
-
- if(!result)
+
+ if (!result)
return new BadRequestObjectResult("Could not delete Technology");
return new OkResult();
}
}
-} \ No newline at end of file
+}
diff --git a/src/DevHive.Web/Controllers/UserController.cs b/src/DevHive.Web/Controllers/UserController.cs
index 0960915..26271b2 100644
--- a/src/DevHive.Web/Controllers/UserController.cs
+++ b/src/DevHive.Web/Controllers/UserController.cs
@@ -20,7 +20,7 @@ namespace DevHive.Web.Controllers
[ApiController]
[Route("/api/[controller]")]
[Authorize(Roles = "User")]
- public class UserController: ControllerBase
+ public class UserController : ControllerBase
{
private readonly UserService _userService;
private readonly IMapper _userMapper;
@@ -154,7 +154,7 @@ namespace DevHive.Web.Controllers
await this._userService.RemoveFriend(userId, friendId);
return new OkResult();
}
-
+
[HttpDelete]
[Route("RemoveLanguageFromUser")]
public async Task<IActionResult> RemoveLanguageFromUser(Guid userId, [FromBody] LanguageWebModel languageWebModel)
@@ -176,7 +176,7 @@ namespace DevHive.Web.Controllers
new OkResult() :
new BadRequestResult();
}
-
+
#endregion
}
}