Skip to content

Commit

Permalink
Merge pull request #172 from amosproj/71-delete-resource
Browse files Browse the repository at this point in the history
71 delete resource
  • Loading branch information
Faoilthiama authored Jan 24, 2023
2 parents a328ec0 + dfefdc8 commit fa4ea80
Show file tree
Hide file tree
Showing 28 changed files with 3,991 additions and 1,319 deletions.
1,213 changes: 675 additions & 538 deletions src/deskstar-backend/Deskstar/Controllers/ResourcesController.cs

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/deskstar-backend/Deskstar/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public UserController(ILogger<UserController> logger, IUserUsecases userUsecases
/// Sample request:
/// Get /users with JWT Token
/// </remarks>
///
///
/// <response code="200">List of user information in JSON Format</response>
/// <response code="404">Not Found</response>
/// <response code="500">Internal Server Error</response>
Expand Down Expand Up @@ -84,7 +84,7 @@ public IActionResult Get()
/// Sample request:
/// Get /users/me with JWT Token
/// </remarks>
///
///
/// <response code="200">Returns information about the logged in user</response>
/// <response code="404">Not Found</response>
/// <response code="500">Internal Server Error</response>
Expand Down Expand Up @@ -248,7 +248,7 @@ public IActionResult UpdateUser(UserProfileDto userDto)
{
var mapper = _autoMapperConfiguration.GetConfiguration().CreateMapper();
var user = mapper.Map<UserProfileDto, User>(userDto);

_userUsecases.UpdateUser(userId, user);

return Ok();
Expand All @@ -264,7 +264,7 @@ public IActionResult UpdateUser(UserProfileDto userDto)
return Problem(statusCode: 500);
}
}

/// <summary>
/// Update given user information
/// </summary>
Expand Down Expand Up @@ -317,7 +317,7 @@ public IActionResult UpdateGivenUser(UserProfileDto userDto)
return Problem(statusCode: 500);
}
}

/// <summary>
/// Delete given user
/// </summary>
Expand All @@ -330,7 +330,7 @@ public IActionResult UpdateGivenUser(UserProfileDto userDto)
/// <response code="200">Empty Response</response>
/// <response code="404">Not Found</response>
/// <response code="500">Internal Server Error</response>
[HttpDelete("delete/{userId}")]
[HttpDelete("{userId}")]
[Authorize(Policy = "Admin")]
[ProducesResponseType(typeof(void), StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
Expand Down Expand Up @@ -366,4 +366,4 @@ public IActionResult DeleteGivenUser(string userId)
return Problem(statusCode: 500);
}
}
}
}
Loading

0 comments on commit fa4ea80

Please sign in to comment.