We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fb95ca commit 4b10978Copy full SHA for 4b10978
models/badges.js
@@ -43,12 +43,15 @@ const fetchUserBadges = async (username) => {
43
userExists = true
44
const userID = result.user.id
45
const snapshot = await badgeModel.get()
46
+
47
snapshot.forEach((item) => {
48
if (item.data()?.users?.includes(userID)) {
- userBadges.push({ title: item.data().title, description: item.data().description })
49
+ const { title, description } = item.data()
50
+ userBadges.push({ title, description })
51
}
52
})
53
54
55
return { userExists, userBadges }
56
} catch (err) {
57
logger.error('Error retrieving user badges', err)
0 commit comments