Add storedDataUrls to GetCurrentUser

This commit is contained in:
Dominic Villemure
2024-06-30 12:39:24 -04:00
parent 2603582286
commit 90d76c32ce
5 changed files with 25 additions and 0 deletions

View File

@@ -19,5 +19,6 @@ public class UserModel
public string Description { get; init; } = string.Empty; public string Description { get; init; } = string.Empty;
public SocialNetworksModel SocialNetworks { get; init; } = new(); public SocialNetworksModel SocialNetworks { get; init; } = new();
public ProfileColorsModel ProfileColors { get; init; } = new(); public ProfileColorsModel ProfileColors { get; init; } = new();
public StoredDataUrlsModel StoredDataUrls { get; init; } = new();
public string ProfilePictureUrl { get; set; } = string.Empty; public string ProfilePictureUrl { get; set; } = string.Empty;
} }

View File

@@ -0,0 +1,8 @@
namespace Hutopy.Application.Users.Models;
public class StoredDataUrlsModel
{
public string BannerPictureUrl { get; set; } = string.Empty;
public string ProfilePictureUrl { get; set; } = string.Empty;
public string WebsiteIconUrl { get; set; } = string.Empty;
}

View File

@@ -41,6 +41,8 @@ public class GetCurrentUserQueryHandler(
About = identityUser.About ?? "", About = identityUser.About ?? "",
Description = identityUser.Description ?? "", Description = identityUser.Description ?? "",
SocialNetworks = identityUser.SocialNetworks, SocialNetworks = identityUser.SocialNetworks,
ProfileColors = identityUser.ProfileColors,
StoredDataUrls = identityUser.StoredDataUrls,
UserTransactions = transactions, UserTransactions = transactions,
TotalBalance = transactions.Sum(x => x.Amount), TotalBalance = transactions.Sum(x => x.Amount),
UserRoles = roles, UserRoles = roles,

View File

@@ -18,6 +18,8 @@ public class UserDto
public string About { get; init; } = string.Empty; public string About { get; init; } = string.Empty;
public string Description { get; init; } = string.Empty; public string Description { get; init; } = string.Empty;
public SocialNetworksModel SocialNetworks { get; init; } = new(); public SocialNetworksModel SocialNetworks { get; init; } = new();
public ProfileColorsModel ProfileColors { get; init; } = new();
public StoredDataUrlsModel StoredDataUrls { get; init; } = new();
public List<UserTransactionDto> UserTransactions { get; init; } = []; public List<UserTransactionDto> UserTransactions { get; init; } = [];
public IList<string> UserRoles { get; init; } = []; public IList<string> UserRoles { get; init; } = [];
public required decimal TotalBalance { get; init; } public required decimal TotalBalance { get; init; }

View File

@@ -171,6 +171,12 @@ public class IdentityService(
BannerBottom = response.ProfileColors.BannerBottom, BannerBottom = response.ProfileColors.BannerBottom,
Accent = response.ProfileColors.Accent, Accent = response.ProfileColors.Accent,
Menu = response.ProfileColors.Menu Menu = response.ProfileColors.Menu
},
StoredDataUrls = new StoredDataUrlsModel
{
ProfilePictureUrl = response.StoredDataUrls.ProfilePictureUrl,
BannerPictureUrl = response.StoredDataUrls.BannerPictureUrl,
WebsiteIconUrl = response.StoredDataUrls.WebsiteIconUrl,
} }
}; };
@@ -215,6 +221,12 @@ public class IdentityService(
BannerBottom = response.ProfileColors.BannerBottom, BannerBottom = response.ProfileColors.BannerBottom,
Accent = response.ProfileColors.Accent, Accent = response.ProfileColors.Accent,
Menu = response.ProfileColors.Menu Menu = response.ProfileColors.Menu
},
StoredDataUrls = new StoredDataUrlsModel
{
ProfilePictureUrl = response.StoredDataUrls.ProfilePictureUrl,
BannerPictureUrl = response.StoredDataUrls.BannerPictureUrl,
WebsiteIconUrl = response.StoredDataUrls.WebsiteIconUrl,
} }
}; };