@aneuhold/be-ts-db-lib 1.0.25 → 1.0.26

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TaskValidator.d.ts","sourceRoot":"","sources":["../../../src/validators/dashboard/TaskValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAyB,MAAM,0BAA0B,CAAC;AAGhF,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAI1C,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa,CAAC;IACrE,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BxD,oBAAoB,CACxB,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC;IAqBV,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CA0C7D"}
1
+ {"version":3,"file":"TaskValidator.d.ts","sourceRoot":"","sources":["../../../src/validators/dashboard/TaskValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAyB,MAAM,0BAA0B,CAAC;AAGhF,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAI1C,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,UAAU,CAAC,aAAa,CAAC;IACrE,iBAAiB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBxD,oBAAoB,CACxB,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,GAClC,OAAO,CAAC,IAAI,CAAC;IAqBV,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CA0C7D"}
@@ -18,15 +18,8 @@ class DashboardTaskValidator extends BaseValidator_1.default {
18
18
  if (usersFound.length !== userIds.length) {
19
19
  errors.push(`Not all users exist. Found: ${usersFound.length}, expected: ${userIds.length}. List searched was: ${JSON.stringify(userIds)}.`);
20
20
  }
21
- // Check if the task has a parent, and if so, that it exists
22
- if (newTask.parentTaskId) {
23
- const parentTask = await DashboardTaskRepository_1.default.getRepo().get({
24
- _id: newTask.parentTaskId
25
- });
26
- if (!parentTask) {
27
- errors.push(`Parent task with ID: ${newTask.parentTaskId} does not exist.`);
28
- }
29
- }
21
+ // Do not check if it has a parent, becuase multiple could be inserted at
22
+ // once and the parent may not exist yet.
30
23
  if (errors.length > 0) {
31
24
  core_ts_lib_1.ErrorUtils.throwErrorList(errors, newTask);
32
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aneuhold/be-ts-db-lib",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "A backend database library meant to actually interact with various databases in personal projects",
5
5
  "author": "Anton G Neuhold Jr <agneuhold@gmail.com>",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@aneuhold/be-ts-lib": "^1.0.6",
44
- "@aneuhold/core-ts-db-lib": "^1.0.26",
44
+ "@aneuhold/core-ts-db-lib": "^1.0.28",
45
45
  "@aneuhold/core-ts-lib": "^1.1.10",
46
46
  "bson": "^6.2.0",
47
47
  "mongodb": "^6.3.0"