@aneuhold/be-ts-db-lib 1.0.13 → 1.0.15
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;
|
|
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"}
|
|
@@ -13,10 +13,10 @@ class DashboardTaskValidator extends BaseValidator_1.default {
|
|
|
13
13
|
const errors = [];
|
|
14
14
|
// Check if the user exists, and any shared users exist
|
|
15
15
|
const userRepo = UserRepository_1.default.getRepo();
|
|
16
|
-
const
|
|
17
|
-
const usersFound = await userRepo.getList(
|
|
18
|
-
if (usersFound.length !==
|
|
19
|
-
errors.push(`Not all users exist. Found: ${usersFound.length}, expected: ${
|
|
16
|
+
const userIds = [newTask.userId, ...newTask.sharedWith];
|
|
17
|
+
const usersFound = await userRepo.getList(userIds);
|
|
18
|
+
if (usersFound.length !== userIds.length) {
|
|
19
|
+
errors.push(`Not all users exist. Found: ${usersFound.length}, expected: ${userIds.length}. List searched was: ${JSON.stringify(userIds)}.`);
|
|
20
20
|
}
|
|
21
21
|
// Check if the task has a parent, and if so, that it exists
|
|
22
22
|
if (newTask.parentTaskId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aneuhold/be-ts-db-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
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",
|