Added profile ProfileColors and Profile images
This commit is contained in:
@@ -8,6 +8,9 @@ public class UpdateMyUser : EndpointGroupBase
|
||||
{
|
||||
app.MapGroup(this)
|
||||
.RequireAuthorization()
|
||||
.MapPost(UpdateCurrentUserProfilePicture, "/profile-picture")
|
||||
.MapPost(UpdateCurrentUserBannerPicture, "/banner-picture")
|
||||
.MapPost(UpdateCurrentUserWebsiteIcon, "/website-icon")
|
||||
.MapPatch("/profile", UpdateCurrentUser);
|
||||
}
|
||||
|
||||
@@ -16,5 +19,21 @@ public class UpdateMyUser : EndpointGroupBase
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<string> UpdateCurrentUserProfilePicture(ISender sender, Stream stream)
|
||||
{
|
||||
var command = new UploadProfilePictureCommand { ProfilePicture = stream };
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<string> UpdateCurrentUserBannerPicture(ISender sender, Stream stream)
|
||||
{
|
||||
var command = new UploadBannerPictureCommand { BannerPicture = stream };
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<string> UpdateCurrentUserWebsiteIcon(ISender sender, Stream stream)
|
||||
{
|
||||
var command = new UploadWebsiteIconCommand { WebsiteIcon = stream };
|
||||
return await sender.Send(command);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user