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.
@@ -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
- projectId
14
- } = req.query;
15
- const profiles = await getDb().collection("profiles").find({
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 getDb().collection("users").find({
27
+ const users = await db.collection("users").find({
28
28
  _id: {
29
29
  $in: userIds
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",