powr-sdk-api 4.3.1 → 4.3.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.
@@ -3,6 +3,9 @@
3
3
  const {
4
4
  getDb
5
5
  } = require("../services/mongo");
6
+ const {
7
+ ObjectId
8
+ } = require("mongodb");
6
9
  class ScheduledTasksManager {
7
10
  // Create a new scheduled task
8
11
  async createTask(taskData) {
@@ -91,7 +94,7 @@ class ScheduledTasksManager {
91
94
 
92
95
  // Build query based on user role
93
96
  let query = {
94
- _id: taskId
97
+ _id: new ObjectId(taskId)
95
98
  };
96
99
  if (isAdmin) {
97
100
  // Admin can access any task in the project
@@ -128,7 +131,7 @@ class ScheduledTasksManager {
128
131
 
129
132
  // Build query based on user role
130
133
  let query = {
131
- _id: taskId
134
+ _id: new ObjectId(taskId)
132
135
  };
133
136
  if (isAdmin) {
134
137
  // Admin can update any task in the project
@@ -180,7 +183,7 @@ class ScheduledTasksManager {
180
183
 
181
184
  // Build query based on user role
182
185
  let query = {
183
- _id: taskId
186
+ _id: new ObjectId(taskId)
184
187
  };
185
188
  if (isAdmin) {
186
189
  // Admin can delete any task in the project
@@ -225,7 +228,7 @@ class ScheduledTasksManager {
225
228
 
226
229
  // Build query based on user role
227
230
  let query = {
228
- _id: taskId
231
+ _id: new ObjectId(taskId)
229
232
  };
230
233
  if (isAdmin) {
231
234
  // Admin can toggle any task in the project
@@ -271,7 +274,7 @@ class ScheduledTasksManager {
271
274
 
272
275
  // Build query based on user role
273
276
  let query = {
274
- _id: taskId
277
+ _id: new ObjectId(taskId)
275
278
  };
276
279
  if (isAdmin) {
277
280
  // Admin can execute any task in the project
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",