User profile service #2

Merged
Jiri merged 16 commits from 250809_UserProfile into main 2025-08-11 20:10:50 +00:00
2 changed files with 5 additions and 6 deletions
Showing only changes of commit 8058add053 - Show all commits

View file

@ -1,6 +1,6 @@
namespace DrinkRateAPI.ApiModels.UserProfile;
public class ChangeAdminStatusBody
public class UserProfileAdminStatusPut
{
public bool ChangeStatusTo { get; set; }
}

View file

@ -19,8 +19,7 @@ public class UserProfileController : ControllerBase
_userProfileService = userProfileService;
}
[HttpPut(Name = "user_profile")]
public UserProfileGet PutUserProfile(UserProfilePut userProfile)
public UserProfileGet PutUserProfile([FromBody] UserProfilePut userProfile)
{
throw new ApplicationException();
var x = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; //HttpContext.User.Identities.First();
@ -30,7 +29,7 @@ public class UserProfileController : ControllerBase
[HttpPut("{userId}/adminStatus")]
[Authorize(Policy = "AdminOnly")]
[Produces("application/json")]
public async Task<IActionResult> PutUserAdminStatus(string userId, [FromBody] ChangeAdminStatusBody body)
public async Task<IActionResult> PutUserAdminStatus(string userId, [FromBody] UserProfileAdminStatusPut body)
{
var changedProfile = await _userProfileService.PutUserProfileAdminStatusAsync(userId, body.ChangeStatusTo);