Skip to content

Commit 2b07116

Browse files
committed
add checks to return unarchived user
1 parent 3e38daa commit 2b07116

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

models/users.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,16 @@ const fetchPaginatedUsers = async (query) => {
165165
const allUsers = [];
166166

167167
snapshot.forEach((doc) => {
168-
allUsers.push({
169-
id: doc.id,
170-
...doc.data(),
171-
phone: undefined,
172-
email: undefined,
173-
tokens: undefined,
174-
chaincode: undefined,
175-
});
168+
if (!doc.data().roles.archived) {
169+
allUsers.push({
170+
id: doc.id,
171+
...doc.data(),
172+
phone: undefined,
173+
email: undefined,
174+
tokens: undefined,
175+
chaincode: undefined,
176+
});
177+
}
176178
});
177179
return {
178180
allUsers,

0 commit comments

Comments
 (0)