Skip to content

Commit 4b10978

Browse files
committed
Increased the readability of code
1 parent 4fb95ca commit 4b10978

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

models/badges.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@ const fetchUserBadges = async (username) => {
4343
userExists = true
4444
const userID = result.user.id
4545
const snapshot = await badgeModel.get()
46+
4647
snapshot.forEach((item) => {
4748
if (item.data()?.users?.includes(userID)) {
48-
userBadges.push({ title: item.data().title, description: item.data().description })
49+
const { title, description } = item.data()
50+
userBadges.push({ title, description })
4951
}
5052
})
5153
}
54+
5255
return { userExists, userBadges }
5356
} catch (err) {
5457
logger.error('Error retrieving user badges', err)

0 commit comments

Comments
 (0)