Added profile ProfileColors and Profile images

This commit is contained in:
Dominic Villemure
2024-06-30 12:35:14 -04:00
parent 0e318eae32
commit 2603582286
27 changed files with 1017 additions and 119 deletions

View File

@@ -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);
}
}