generated from nhcarrigan/template
feat: show equipped items on character sheet and public profile
This commit is contained in:
@@ -75,6 +75,10 @@ profileRouter.get("/:discordId", async (context) => {
|
||||
return { id, name: title?.name ?? id };
|
||||
});
|
||||
|
||||
const equippedItems = (state?.equipment ?? [])
|
||||
.filter((e) => e.owned && e.equipped)
|
||||
.map(({ name, type, rarity, bonus }) => ({ name, type, rarity, bonus }));
|
||||
|
||||
return context.json({
|
||||
characterName: player.characterName,
|
||||
pronouns: player.pronouns ?? "",
|
||||
@@ -106,6 +110,7 @@ profileRouter.get("/:discordId", async (context) => {
|
||||
achievementsUnlocked,
|
||||
unlockedTitles,
|
||||
activeTitle: player.activeTitle ?? "",
|
||||
equippedItems,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user