powr-sdk-api 3.1.6 → 3.2.1

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.
@@ -109,6 +109,12 @@ router.get('/', async (req, res) => {
109
109
  }
110
110
  const db = await getDb();
111
111
 
112
+ // Debug: Check if posts exist
113
+ const debugPosts = await db.collection('feeds').find(query).toArray();
114
+ console.log('Debug - Found posts:', debugPosts.length);
115
+ console.log('Debug - Query:', query);
116
+ console.log('Debug - ProjectId:', projectId);
117
+
112
118
  // Get posts with author info
113
119
  const posts = await db.collection('feeds').aggregate([{
114
120
  $match: query
@@ -128,7 +134,10 @@ router.get('/', async (req, res) => {
128
134
  as: 'author'
129
135
  }
130
136
  }, {
131
- $unwind: '$author'
137
+ $unwind: {
138
+ path: '$author',
139
+ preserveNullAndEmptyArrays: true
140
+ }
132
141
  }, {
133
142
  $project: {
134
143
  'author.password': 0,
@@ -176,7 +185,10 @@ router.get('/:id', async (req, res) => {
176
185
  as: 'author'
177
186
  }
178
187
  }, {
179
- $unwind: '$author'
188
+ $unwind: {
189
+ path: '$author',
190
+ preserveNullAndEmptyArrays: true
191
+ }
180
192
  }, {
181
193
  $project: {
182
194
  'author.password': 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "3.1.6",
3
+ "version": "3.2.1",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",