Rename name to id in the stored badge information and expose id in the profile endpoint

This commit is contained in:
Ehren Kret
2021-09-15 16:49:20 -05:00
parent 34e21b9f7b
commit 8a8e6e7b49
4 changed files with 32 additions and 22 deletions

View File

@@ -90,7 +90,9 @@ public class ConfiguredProfileBadgeConverter implements ProfileBadgeConverter {
.filter(accountBadge -> accountBadge.isVisible()
&& now.isBefore(accountBadge.getExpiration())
&& knownBadges.containsKey(accountBadge.getId()))
.map(accountBadge -> new Badge(knownBadges.get(accountBadge.getId()).getImageUrl(),
.map(accountBadge -> new Badge(
accountBadge.getId(),
knownBadges.get(accountBadge.getId()).getImageUrl(),
resourceBundle.getString(accountBadge.getId() + "_name"),
resourceBundle.getString(accountBadge.getId() + "_description")))
.collect(Collectors.toList());