powr-sdk-api 2.4.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/routes/profiles.js +5 -5
- package/package.json +1 -1
package/dist/routes/profiles.js
CHANGED
|
@@ -9,10 +9,10 @@ const {
|
|
|
9
9
|
// Get all users for a project
|
|
10
10
|
router.get("/", async (req, res) => {
|
|
11
11
|
try {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const profiles = await
|
|
12
|
+
const projectId = req.projectId; // Use middleware-injected projectId
|
|
13
|
+
|
|
14
|
+
const db = await getDb();
|
|
15
|
+
const profiles = await db.collection("profiles").find({
|
|
16
16
|
projectId: projectId
|
|
17
17
|
}).toArray();
|
|
18
18
|
if (profiles.length === 0) {
|
|
@@ -24,7 +24,7 @@ router.get("/", async (req, res) => {
|
|
|
24
24
|
|
|
25
25
|
// Get core user data for all profiles
|
|
26
26
|
const userIds = profiles.map(profile => profile.userId);
|
|
27
|
-
const users = await
|
|
27
|
+
const users = await db.collection("users").find({
|
|
28
28
|
_id: {
|
|
29
29
|
$in: userIds
|
|
30
30
|
}
|