@aneuhold/be-ts-db-lib 3.0.0 → 3.0.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.
- package/CHANGELOG.md +11 -0
- package/lib/repositories/dashboard/DashboardNonogramKatanaItemRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardNonogramKatanaItemRepository.js +7 -3
- package/lib/repositories/dashboard/DashboardNonogramKatanaItemRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardNonogramKatanaItemRepository.ts +9 -3
- package/lib/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.js +7 -3
- package/lib/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.ts +10 -4
- package/lib/repositories/dashboard/DashboardTaskRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardTaskRepository.js +6 -5
- package/lib/repositories/dashboard/DashboardTaskRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardTaskRepository.ts +7 -6
- package/lib/repositories/dashboard/DashboardUserConfigRepository.d.ts.map +1 -1
- package/lib/repositories/dashboard/DashboardUserConfigRepository.js +9 -10
- package/lib/repositories/dashboard/DashboardUserConfigRepository.js.map +1 -1
- package/lib/repositories/dashboard/DashboardUserConfigRepository.ts +16 -14
- package/lib/services/MigrationService.d.ts.map +1 -1
- package/lib/services/MigrationService.js +308 -129
- package/lib/services/MigrationService.js.map +1 -1
- package/lib/services/MigrationService.ts +379 -135
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 🔖 [3.0.1] (2025-11-25)
|
|
9
|
+
|
|
10
|
+
### 🏗️ Changed
|
|
11
|
+
|
|
12
|
+
- All dashboard repositories now require `docType` in delete and update queries for stricter document targeting.
|
|
13
|
+
- Improved internal filtering in `getAllForUser` and similar methods to use repository-level collection access and default filters.
|
|
14
|
+
- Refactored `DashboardUserConfigRepository` to ensure collaborator and userId references always include `docType`.
|
|
15
|
+
- Updated migration logic in `MigrationService` for more robust and complete UUID migration, including all dashboard-related document types.
|
|
16
|
+
- Added `uuid` as a dependency in `package.json`.
|
|
17
|
+
|
|
8
18
|
## 🔖 [3.0.0] (2025-11-23)
|
|
9
19
|
|
|
10
20
|
### 🏗️ Changed
|
|
@@ -94,6 +104,7 @@ Updated dependencies: now requires `@aneuhold/core-ts-db-lib@^3.0.0`, `@aneuhold
|
|
|
94
104
|
|
|
95
105
|
<!-- Link References -->
|
|
96
106
|
|
|
107
|
+
[3.0.1]: https://github.com/aneuhold/ts-libs/compare/be-ts-db-lib-v3.0.0...be-ts-db-lib-v3.0.1
|
|
97
108
|
[3.0.0]: https://github.com/aneuhold/ts-libs/compare/be-ts-db-lib-v2.0.85...be-ts-db-lib-v3.0.0
|
|
98
109
|
[2.0.85]: https://github.com/aneuhold/ts-libs/compare/be-ts-db-lib-v2.0.84...be-ts-db-lib-v2.0.85
|
|
99
110
|
[2.0.84]: https://github.com/aneuhold/ts-libs/compare/be-ts-db-lib-v2.0.83...be-ts-db-lib-v2.0.84
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardNonogramKatanaItemRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardNonogramKatanaItemRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,qCAAsC,SAAQ,uBAAuB,CAAC,kBAAkB,CAAC;IAC5G,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAwC;IAEzE,OAAO;IAQP,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardNonogramKatanaItemRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardNonogramKatanaItemRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,qCAAsC,SAAQ,uBAAuB,CAAC,kBAAkB,CAAC;IAC5G,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAwC;IAEzE,OAAO;IAQP,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;IAsBrD,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAElC;;OAEG;WACW,OAAO,IAAI,qCAAqC;IAQ9D;;;;OAIG;IACG,aAAa,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAQjE"}
|
|
@@ -14,11 +14,15 @@ export default class DashboardNonogramKatanaItemRepository extends DashboardBase
|
|
|
14
14
|
const nonogramKatanaRepo = DashboardNonogramKatanaItemRepository.getRepo();
|
|
15
15
|
return {
|
|
16
16
|
deleteOne: async (userId) => {
|
|
17
|
-
await (await nonogramKatanaRepo.getCollection()).deleteMany({
|
|
17
|
+
await (await nonogramKatanaRepo.getCollection()).deleteMany({
|
|
18
|
+
userId,
|
|
19
|
+
docType: NonogramKatanaItem.docType
|
|
20
|
+
});
|
|
18
21
|
},
|
|
19
22
|
deleteList: async (userIds) => {
|
|
20
23
|
await (await nonogramKatanaRepo.getCollection()).deleteMany({
|
|
21
|
-
userId: { $in: userIds }
|
|
24
|
+
userId: { $in: userIds },
|
|
25
|
+
docType: NonogramKatanaItem.docType
|
|
22
26
|
});
|
|
23
27
|
}
|
|
24
28
|
};
|
|
@@ -40,7 +44,7 @@ export default class DashboardNonogramKatanaItemRepository extends DashboardBase
|
|
|
40
44
|
* @param userId The ID of the user to get items for.
|
|
41
45
|
*/
|
|
42
46
|
async getAllForUser(userId) {
|
|
43
|
-
const collection = await
|
|
47
|
+
const collection = await DashboardNonogramKatanaItemRepository.getRepo().getCollection();
|
|
44
48
|
const filter = {
|
|
45
49
|
$and: [this.getFilterWithDefault(), { userId }]
|
|
46
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardNonogramKatanaItemRepository.js","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardNonogramKatanaItemRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,oCAAoC,MAAM,2DAA2D,CAAC;AAC7G,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,qCAAsC,SAAQ,uBAA2C;IACpG,MAAM,CAAC,iBAAiB,CAAyC;IAEzE;QACE,KAAK,CACH,kBAAkB,CAAC,OAAO,EAC1B,IAAI,oCAAoC,EAAE,EAC1C,aAAa,CAAC,MAAM,CACrB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,MAAM,kBAAkB,GAAG,qCAAqC,CAAC,OAAO,EAAE,CAAC;QAC3E,OAAO;YACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;gBAC1B,MAAM,
|
|
1
|
+
{"version":3,"file":"DashboardNonogramKatanaItemRepository.js","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardNonogramKatanaItemRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGpE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,oCAAoC,MAAM,2DAA2D,CAAC;AAC7G,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,qCAAsC,SAAQ,uBAA2C;IACpG,MAAM,CAAC,iBAAiB,CAAyC;IAEzE;QACE,KAAK,CACH,kBAAkB,CAAC,OAAO,EAC1B,IAAI,oCAAoC,EAAE,EAC1C,aAAa,CAAC,MAAM,CACrB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,MAAM,kBAAkB,GAAG,qCAAqC,CAAC,OAAO,EAAE,CAAC;QAC3E,OAAO;YACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;gBAC1B,MAAM,CACJ,MAAM,kBAAkB,CAAC,aAAa,EAAE,CACzC,CAAC,UAAU,CAAC;oBACX,MAAM;oBACN,OAAO,EAAE,kBAAkB,CAAC,OAAO;iBACpC,CAAC,CAAC;YACL,CAAC;YACD,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBAC5B,MAAM,CACJ,MAAM,kBAAkB,CAAC,aAAa,EAAE,CACzC,CAAC,UAAU,CAAC;oBACX,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;oBACxB,OAAO,EAAE,kBAAkB,CAAC,OAAO;iBACpC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;IAES,gBAAgB,KAAU,CAAC;IAErC;;OAEG;IACI,MAAM,CAAC,OAAO;QACnB,IAAI,CAAC,qCAAqC,CAAC,iBAAiB,EAAE,CAAC;YAC7D,qCAAqC,CAAC,iBAAiB;gBACrD,IAAI,qCAAqC,EAAE,CAAC;QAChD,CAAC;QACD,OAAO,qCAAqC,CAAC,iBAAiB,CAAC;IACjE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,MAAY;QAC9B,MAAM,UAAU,GAAG,MAAM,qCAAqC,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,CAAC;QACzF,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;SAChD,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;QACvD,OAAO,MAA8B,CAAC;IACxC,CAAC;CACF"}
|
|
@@ -23,13 +23,19 @@ export default class DashboardNonogramKatanaItemRepository extends DashboardBase
|
|
|
23
23
|
const nonogramKatanaRepo = DashboardNonogramKatanaItemRepository.getRepo();
|
|
24
24
|
return {
|
|
25
25
|
deleteOne: async (userId) => {
|
|
26
|
-
await (
|
|
26
|
+
await (
|
|
27
|
+
await nonogramKatanaRepo.getCollection()
|
|
28
|
+
).deleteMany({
|
|
29
|
+
userId,
|
|
30
|
+
docType: NonogramKatanaItem.docType
|
|
31
|
+
});
|
|
27
32
|
},
|
|
28
33
|
deleteList: async (userIds) => {
|
|
29
34
|
await (
|
|
30
35
|
await nonogramKatanaRepo.getCollection()
|
|
31
36
|
).deleteMany({
|
|
32
|
-
userId: { $in: userIds }
|
|
37
|
+
userId: { $in: userIds },
|
|
38
|
+
docType: NonogramKatanaItem.docType
|
|
33
39
|
});
|
|
34
40
|
}
|
|
35
41
|
};
|
|
@@ -54,7 +60,7 @@ export default class DashboardNonogramKatanaItemRepository extends DashboardBase
|
|
|
54
60
|
* @param userId The ID of the user to get items for.
|
|
55
61
|
*/
|
|
56
62
|
async getAllForUser(userId: UUID): Promise<NonogramKatanaItem[]> {
|
|
57
|
-
const collection = await
|
|
63
|
+
const collection = await DashboardNonogramKatanaItemRepository.getRepo().getCollection();
|
|
58
64
|
const filter = {
|
|
59
65
|
$and: [this.getFilterWithDefault(), { userId }]
|
|
60
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardNonogramKatanaUpgradeRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,wCAAyC,SAAQ,uBAAuB,CAAC,qBAAqB,CAAC;IAClH,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAuD;IAEvF,OAAO;IAQP,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardNonogramKatanaUpgradeRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,wCAAyC,SAAQ,uBAAuB,CAAC,qBAAqB,CAAC;IAClH,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAuD;IAEvF,OAAO;IAQP,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;IAsBrD,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAElC;;OAEG;WACW,OAAO,IAAI,wCAAwC;IAQjE;;;;OAIG;IACG,aAAa,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAQpE"}
|
|
@@ -14,11 +14,15 @@ export default class DashboardNonogramKatanaUpgradeRepository extends DashboardB
|
|
|
14
14
|
const upgradeRepo = DashboardNonogramKatanaUpgradeRepository.getRepo();
|
|
15
15
|
return {
|
|
16
16
|
deleteOne: async (userId) => {
|
|
17
|
-
await (await upgradeRepo.getCollection()).deleteMany({
|
|
17
|
+
await (await upgradeRepo.getCollection()).deleteMany({
|
|
18
|
+
userId,
|
|
19
|
+
docType: NonogramKatanaUpgrade.docType
|
|
20
|
+
});
|
|
18
21
|
},
|
|
19
22
|
deleteList: async (userIds) => {
|
|
20
23
|
await (await upgradeRepo.getCollection()).deleteMany({
|
|
21
|
-
userId: { $in: userIds }
|
|
24
|
+
userId: { $in: userIds },
|
|
25
|
+
docType: NonogramKatanaUpgrade.docType
|
|
22
26
|
});
|
|
23
27
|
}
|
|
24
28
|
};
|
|
@@ -40,7 +44,7 @@ export default class DashboardNonogramKatanaUpgradeRepository extends DashboardB
|
|
|
40
44
|
* @param userId The ID of the user to get upgrades for.
|
|
41
45
|
*/
|
|
42
46
|
async getAllForUser(userId) {
|
|
43
|
-
const collection = await
|
|
47
|
+
const collection = await DashboardNonogramKatanaUpgradeRepository.getRepo().getCollection();
|
|
44
48
|
const filter = {
|
|
45
49
|
$and: [this.getFilterWithDefault(), { userId }]
|
|
46
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardNonogramKatanaUpgradeRepository.js","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,uCAAuC,MAAM,8DAA8D,CAAC;AACnH,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,wCAAyC,SAAQ,uBAA8C;IAC1G,MAAM,CAAC,iBAAiB,CAAuD;IAEvF;QACE,KAAK,CACH,qBAAqB,CAAC,OAAO,EAC7B,IAAI,uCAAuC,EAAE,EAC7C,aAAa,CAAC,MAAM,CACrB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,MAAM,WAAW,GAAG,wCAAwC,CAAC,OAAO,EAAE,CAAC;QACvE,OAAO;YACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;gBAC1B,MAAM,
|
|
1
|
+
{"version":3,"file":"DashboardNonogramKatanaUpgradeRepository.js","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardNonogramKatanaUpgradeRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,uCAAuC,MAAM,8DAA8D,CAAC;AACnH,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,wCAAyC,SAAQ,uBAA8C;IAC1G,MAAM,CAAC,iBAAiB,CAAuD;IAEvF;QACE,KAAK,CACH,qBAAqB,CAAC,OAAO,EAC7B,IAAI,uCAAuC,EAAE,EAC7C,aAAa,CAAC,MAAM,CACrB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,uBAAuB;QAC5B,MAAM,WAAW,GAAG,wCAAwC,CAAC,OAAO,EAAE,CAAC;QACvE,OAAO;YACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;gBAC1B,MAAM,CACJ,MAAM,WAAW,CAAC,aAAa,EAAE,CAClC,CAAC,UAAU,CAAC;oBACX,MAAM;oBACN,OAAO,EAAE,qBAAqB,CAAC,OAAO;iBACvC,CAAC,CAAC;YACL,CAAC;YACD,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBAC5B,MAAM,CACJ,MAAM,WAAW,CAAC,aAAa,EAAE,CAClC,CAAC,UAAU,CAAC;oBACX,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;oBACxB,OAAO,EAAE,qBAAqB,CAAC,OAAO;iBACvC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;IAES,gBAAgB,KAAU,CAAC;IAErC;;OAEG;IACI,MAAM,CAAC,OAAO;QACnB,IAAI,CAAC,wCAAwC,CAAC,iBAAiB,EAAE,CAAC;YAChE,wCAAwC,CAAC,iBAAiB;gBACxD,IAAI,wCAAwC,EAAE,CAAC;QACnD,CAAC;QACD,OAAO,wCAAwC,CAAC,iBAAiB,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,aAAa,CAAC,MAAY;QAC9B,MAAM,UAAU,GAAG,MAAM,wCAAwC,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,CAAC;QAC5F,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;SAChD,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC;QACvD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -23,13 +23,19 @@ export default class DashboardNonogramKatanaUpgradeRepository extends DashboardB
|
|
|
23
23
|
const upgradeRepo = DashboardNonogramKatanaUpgradeRepository.getRepo();
|
|
24
24
|
return {
|
|
25
25
|
deleteOne: async (userId) => {
|
|
26
|
-
await (
|
|
26
|
+
await (
|
|
27
|
+
await upgradeRepo.getCollection()
|
|
28
|
+
).deleteMany({
|
|
29
|
+
userId,
|
|
30
|
+
docType: NonogramKatanaUpgrade.docType
|
|
31
|
+
});
|
|
27
32
|
},
|
|
28
33
|
deleteList: async (userIds) => {
|
|
29
34
|
await (
|
|
30
35
|
await upgradeRepo.getCollection()
|
|
31
36
|
).deleteMany({
|
|
32
|
-
userId: { $in: userIds }
|
|
37
|
+
userId: { $in: userIds },
|
|
38
|
+
docType: NonogramKatanaUpgrade.docType
|
|
33
39
|
});
|
|
34
40
|
}
|
|
35
41
|
};
|
|
@@ -54,11 +60,11 @@ export default class DashboardNonogramKatanaUpgradeRepository extends DashboardB
|
|
|
54
60
|
* @param userId The ID of the user to get upgrades for.
|
|
55
61
|
*/
|
|
56
62
|
async getAllForUser(userId: UUID): Promise<NonogramKatanaUpgrade[]> {
|
|
57
|
-
const collection = await
|
|
63
|
+
const collection = await DashboardNonogramKatanaUpgradeRepository.getRepo().getCollection();
|
|
58
64
|
const filter = {
|
|
59
65
|
$and: [this.getFilterWithDefault(), { userId }]
|
|
60
66
|
};
|
|
61
67
|
const result = await collection.find(filter).toArray();
|
|
62
|
-
return result
|
|
68
|
+
return result;
|
|
63
69
|
}
|
|
64
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardTaskRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardTaskRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAwB,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,uBAAuB,CAAC,aAAa,CAAC;IACzF,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAA0B;IAE3D;;OAEG;IACH,OAAO;IASP;;;;;OAKG;IACH,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardTaskRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardTaskRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAwB,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,uBAAwB,SAAQ,uBAAuB,CAAC,aAAa,CAAC;IACzF,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAA0B;IAE3D;;OAEG;IACH,OAAO;IASP;;;;;OAKG;IACH,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;IA6BrD,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAElC;;;;OAIG;WACW,OAAO,IAAI,uBAAuB;IAOhD;;;;;;OAMG;IACY,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;IAMzD;;;;;OAKG;IACY,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAMhE;;;;;;;OAOG;IACG,aAAa,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAyB3D;;;;;;OAMG;YACW,qBAAqB;CAYpC"}
|
|
@@ -31,18 +31,19 @@ export default class DashboardTaskRepository extends DashboardBaseRepository {
|
|
|
31
31
|
deleteOne: async (userId) => {
|
|
32
32
|
const taskCollection = await taskRepo.getCollection();
|
|
33
33
|
// Remove all tasks for the user
|
|
34
|
-
await taskCollection.deleteMany({ userId });
|
|
34
|
+
await taskCollection.deleteMany({ userId, docType: DashboardTask.docType });
|
|
35
35
|
// Remove all assignedTo references for the user
|
|
36
|
-
await taskCollection.updateMany({ assignedTo: userId }, { $set: { assignedTo: undefined } });
|
|
36
|
+
await taskCollection.updateMany({ assignedTo: userId, docType: DashboardTask.docType }, { $set: { assignedTo: undefined } });
|
|
37
37
|
},
|
|
38
38
|
deleteList: async (userIds) => {
|
|
39
39
|
const taskCollection = await taskRepo.getCollection();
|
|
40
40
|
// Remove all tasks for the users
|
|
41
41
|
await taskCollection.deleteMany({
|
|
42
|
-
userId: { $in: userIds }
|
|
42
|
+
userId: { $in: userIds },
|
|
43
|
+
docType: DashboardTask.docType
|
|
43
44
|
});
|
|
44
45
|
// Remove all assignedTo references for the users
|
|
45
|
-
await taskCollection.updateMany({ assignedTo: { $in: userIds } }, { $set: { assignedTo: undefined } });
|
|
46
|
+
await taskCollection.updateMany({ assignedTo: { $in: userIds }, docType: DashboardTask.docType }, { $set: { assignedTo: undefined } });
|
|
46
47
|
}
|
|
47
48
|
};
|
|
48
49
|
}
|
|
@@ -96,7 +97,7 @@ export default class DashboardTaskRepository extends DashboardBaseRepository {
|
|
|
96
97
|
return [];
|
|
97
98
|
}
|
|
98
99
|
const { collaborators } = userConfig;
|
|
99
|
-
const collection = await
|
|
100
|
+
const collection = await DashboardTaskRepository.getRepo().getCollection();
|
|
100
101
|
const filter = {
|
|
101
102
|
$and: [
|
|
102
103
|
this.getFilterWithDefault(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardTaskRepository.js","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardTaskRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,oBAAoB,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TaskRepository extends DashboardBaseRepository<Das
|
|
|
37
37
|
deleteOne: async (userId) => {
|
|
38
38
|
const taskCollection = await taskRepo.getCollection();
|
|
39
39
|
// Remove all tasks for the user
|
|
40
|
-
await taskCollection.deleteMany({ userId });
|
|
40
|
+
await taskCollection.deleteMany({ userId, docType: DashboardTask.docType });
|
|
41
41
|
// Remove all assignedTo references for the user
|
|
42
42
|
await taskCollection.updateMany(
|
|
43
|
-
{ assignedTo: userId },
|
|
43
|
+
{ assignedTo: userId, docType: DashboardTask.docType },
|
|
44
44
|
{ $set: { assignedTo: undefined } }
|
|
45
45
|
);
|
|
46
46
|
},
|
|
@@ -48,11 +48,12 @@ export default class DashboardTaskRepository extends DashboardBaseRepository<Das
|
|
|
48
48
|
const taskCollection = await taskRepo.getCollection();
|
|
49
49
|
// Remove all tasks for the users
|
|
50
50
|
await taskCollection.deleteMany({
|
|
51
|
-
userId: { $in: userIds }
|
|
51
|
+
userId: { $in: userIds },
|
|
52
|
+
docType: DashboardTask.docType
|
|
52
53
|
});
|
|
53
54
|
// Remove all assignedTo references for the users
|
|
54
55
|
await taskCollection.updateMany(
|
|
55
|
-
{ assignedTo: { $in: userIds } },
|
|
56
|
+
{ assignedTo: { $in: userIds }, docType: DashboardTask.docType },
|
|
56
57
|
{ $set: { assignedTo: undefined } }
|
|
57
58
|
);
|
|
58
59
|
}
|
|
@@ -113,7 +114,7 @@ export default class DashboardTaskRepository extends DashboardBaseRepository<Das
|
|
|
113
114
|
return [];
|
|
114
115
|
}
|
|
115
116
|
const { collaborators } = userConfig;
|
|
116
|
-
const collection = await
|
|
117
|
+
const collection = await DashboardTaskRepository.getRepo().getCollection();
|
|
117
118
|
const filter = {
|
|
118
119
|
$and: [
|
|
119
120
|
this.getFilterWithDefault(),
|
|
@@ -128,7 +129,7 @@ export default class DashboardTaskRepository extends DashboardBaseRepository<Das
|
|
|
128
129
|
]
|
|
129
130
|
};
|
|
130
131
|
const result = await collection.find(filter).toArray();
|
|
131
|
-
return result
|
|
132
|
+
return result;
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardUserConfigRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardUserConfigRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAyB,eAAe,
|
|
1
|
+
{"version":3,"file":"DashboardUserConfigRepository.d.ts","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardUserConfigRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAyB,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAG/E,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,uBAAuB,CAAC,mBAAmB,CAAC;IACrG,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAgC;IAEjE;;OAEG;IACH,OAAO;IAIP;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,IAAI,aAAa,CAAC,IAAI,CAAC;IAsCrD,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAElC;;;;OAIG;WACW,OAAO,IAAI,6BAA6B;IAOtD;;;;;;OAMG;IACY,SAAS,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAa1F;;;;;;;OAOG;IACY,UAAU,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAYzF;;;;;;OAMG;IACY,MAAM,CACnB,UAAU,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACvC,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;IAU7C;;;;;;OAMG;IACY,UAAU,CAAC,WAAW,EAAE,OAAO,CAAC,mBAAmB,CAAC,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAkBhG;;;;;OAKG;IACG,UAAU,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAMnE;;;;;;;;;;;OAWG;YACW,2BAA2B;CAgD1C"}
|
|
@@ -23,15 +23,16 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
23
23
|
return {
|
|
24
24
|
deleteOne: async (userId) => {
|
|
25
25
|
const collection = await userConfigRepo.getCollection();
|
|
26
|
-
await collection.deleteOne({ userId });
|
|
27
|
-
await collection.updateMany({ collaborators: userId }, { $pull: { collaborators: userId } });
|
|
26
|
+
await collection.deleteOne({ userId, docType: DashboardUserConfig.docType });
|
|
27
|
+
await collection.updateMany({ collaborators: userId, docType: DashboardUserConfig.docType }, { $pull: { collaborators: userId } });
|
|
28
28
|
},
|
|
29
29
|
deleteList: async (userIds) => {
|
|
30
30
|
const collection = await userConfigRepo.getCollection();
|
|
31
31
|
await collection.deleteMany({
|
|
32
|
-
userId: { $in: userIds }
|
|
32
|
+
userId: { $in: userIds },
|
|
33
|
+
docType: DashboardUserConfig.docType
|
|
33
34
|
});
|
|
34
|
-
await collection.updateMany({ collaborators: { $in: userIds } }, {
|
|
35
|
+
await collection.updateMany({ collaborators: { $in: userIds }, docType: DashboardUserConfig.docType }, {
|
|
35
36
|
$pull: { collaborators: { $in: userIds } }
|
|
36
37
|
});
|
|
37
38
|
},
|
|
@@ -106,9 +107,7 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
106
107
|
const originalDoc = await super.get({ _id: updatedDoc._id });
|
|
107
108
|
const result = await super.update(updatedDoc);
|
|
108
109
|
if (originalDoc) {
|
|
109
|
-
await this.updateCollaboratorsIfNeeded([
|
|
110
|
-
{ originalDoc, updatedDoc: updatedDoc }
|
|
111
|
-
]);
|
|
110
|
+
await this.updateCollaboratorsIfNeeded([{ originalDoc, updatedDoc }]);
|
|
112
111
|
}
|
|
113
112
|
return result;
|
|
114
113
|
}
|
|
@@ -142,7 +141,7 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
142
141
|
*/
|
|
143
142
|
async getForUser(userId) {
|
|
144
143
|
const collection = await this.getCollection();
|
|
145
|
-
const result = await collection.findOne({ userId });
|
|
144
|
+
const result = await collection.findOne(this.getFilterWithDefault({ userId }));
|
|
146
145
|
return result;
|
|
147
146
|
}
|
|
148
147
|
/**
|
|
@@ -171,7 +170,7 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
171
170
|
if (!updatedCollaborators.includes(collaboratorId)) {
|
|
172
171
|
bulkOps.push({
|
|
173
172
|
updateOne: {
|
|
174
|
-
filter: { userId: collaboratorId },
|
|
173
|
+
filter: { userId: collaboratorId, docType: DashboardUserConfig.docType },
|
|
175
174
|
update: { $pull: { collaborators: docSet.originalDoc.userId } }
|
|
176
175
|
}
|
|
177
176
|
});
|
|
@@ -183,7 +182,7 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
183
182
|
if (!originalCollaborators.includes(collaboratorId)) {
|
|
184
183
|
bulkOps.push({
|
|
185
184
|
updateOne: {
|
|
186
|
-
filter: { userId: collaboratorId },
|
|
185
|
+
filter: { userId: collaboratorId, docType: DashboardUserConfig.docType },
|
|
187
186
|
update: {
|
|
188
187
|
$addToSet: { collaborators: docSet.originalDoc.userId }
|
|
189
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardUserConfigRepository.js","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardUserConfigRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIrE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,4BAA4B,MAAM,mDAAmD,CAAC;AAC7F,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,uBAA4C;IAC7F,MAAM,CAAC,iBAAiB,CAAiC;IAEjE;;OAEG;IACH;QACE,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,4BAA4B,EAAE,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC/F,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,uBAAuB;QAC5B,MAAM,cAAc,GAAG,6BAA6B,CAAC,OAAO,EAAE,CAAC;QAC/D,OAAO;YACL,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;gBAC1B,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,aAAa,EAAE,CAAC;gBACxD,MAAM,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DashboardUserConfigRepository.js","sourceRoot":"","sources":["../../../src/repositories/dashboard/DashboardUserConfigRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIrE,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,4BAA4B,MAAM,mDAAmD,CAAC;AAC7F,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,uBAA4C;IAC7F,MAAM,CAAC,iBAAiB,CAAiC;IAEjE;;OAEG;IACH;QACE,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,IAAI,4BAA4B,EAAE,EAAE,aAAa,CAAC,MAAM,CAA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AAE;oBAC9C,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;wBACpD,OAAO,CAAC,IAAI,CAAC;4BACX,SAAS,EAAE;gCACT,MAAM,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE;gCACxE,MAAM,EAAE;oCACN,SAAS,EAAE,EAAE,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE;iCACxD;6BACF;yBACF,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;YAC9C,MAAM,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DashboardUserConfig, User } from '@aneuhold/core-ts-db-lib';
|
|
2
2
|
import type { UUID } from 'crypto';
|
|
3
|
-
import type { AnyBulkWriteOperation, BulkWriteResult,
|
|
3
|
+
import type { AnyBulkWriteOperation, BulkWriteResult, UpdateResult } from 'mongodb';
|
|
4
4
|
import type { RepoListeners } from '../../services/RepoSubscriptionService.js';
|
|
5
5
|
import CleanDocument from '../../util/DocumentCleaner.js';
|
|
6
6
|
import DashboardUserConfigValidator from '../../validators/dashboard/UserConfigValidator.js';
|
|
@@ -29,20 +29,24 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
29
29
|
return {
|
|
30
30
|
deleteOne: async (userId) => {
|
|
31
31
|
const collection = await userConfigRepo.getCollection();
|
|
32
|
-
await collection.deleteOne({ userId });
|
|
32
|
+
await collection.deleteOne({ userId, docType: DashboardUserConfig.docType });
|
|
33
33
|
await collection.updateMany(
|
|
34
|
-
{ collaborators: userId },
|
|
34
|
+
{ collaborators: userId, docType: DashboardUserConfig.docType },
|
|
35
35
|
{ $pull: { collaborators: userId } }
|
|
36
36
|
);
|
|
37
37
|
},
|
|
38
38
|
deleteList: async (userIds) => {
|
|
39
39
|
const collection = await userConfigRepo.getCollection();
|
|
40
40
|
await collection.deleteMany({
|
|
41
|
-
userId: { $in: userIds }
|
|
41
|
+
userId: { $in: userIds },
|
|
42
|
+
docType: DashboardUserConfig.docType
|
|
42
43
|
});
|
|
43
|
-
await collection.updateMany(
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
await collection.updateMany(
|
|
45
|
+
{ collaborators: { $in: userIds }, docType: DashboardUserConfig.docType },
|
|
46
|
+
{
|
|
47
|
+
$pull: { collaborators: { $in: userIds } }
|
|
48
|
+
}
|
|
49
|
+
);
|
|
46
50
|
},
|
|
47
51
|
insertNew: async (user) => {
|
|
48
52
|
if (user.projectAccess.dashboard) {
|
|
@@ -126,9 +130,7 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
126
130
|
const originalDoc = await super.get({ _id: updatedDoc._id });
|
|
127
131
|
const result = await super.update(updatedDoc);
|
|
128
132
|
if (originalDoc) {
|
|
129
|
-
await this.updateCollaboratorsIfNeeded([
|
|
130
|
-
{ originalDoc, updatedDoc: updatedDoc as DashboardUserConfig }
|
|
131
|
-
]);
|
|
133
|
+
await this.updateCollaboratorsIfNeeded([{ originalDoc, updatedDoc }]);
|
|
132
134
|
}
|
|
133
135
|
return result;
|
|
134
136
|
}
|
|
@@ -166,8 +168,8 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
166
168
|
*/
|
|
167
169
|
async getForUser(userId: UUID): Promise<DashboardUserConfig | null> {
|
|
168
170
|
const collection = await this.getCollection();
|
|
169
|
-
const result = await collection.findOne({ userId });
|
|
170
|
-
return result
|
|
171
|
+
const result = await collection.findOne(this.getFilterWithDefault({ userId }));
|
|
172
|
+
return result;
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
/**
|
|
@@ -203,7 +205,7 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
203
205
|
if (!updatedCollaborators.includes(collaboratorId)) {
|
|
204
206
|
bulkOps.push({
|
|
205
207
|
updateOne: {
|
|
206
|
-
filter: { userId: collaboratorId },
|
|
208
|
+
filter: { userId: collaboratorId, docType: DashboardUserConfig.docType },
|
|
207
209
|
update: { $pull: { collaborators: docSet.originalDoc.userId } }
|
|
208
210
|
}
|
|
209
211
|
});
|
|
@@ -215,7 +217,7 @@ export default class DashboardUserConfigRepository extends DashboardBaseReposito
|
|
|
215
217
|
if (!originalCollaborators.includes(collaboratorId)) {
|
|
216
218
|
bulkOps.push({
|
|
217
219
|
updateOne: {
|
|
218
|
-
filter: { userId: collaboratorId },
|
|
220
|
+
filter: { userId: collaboratorId, docType: DashboardUserConfig.docType },
|
|
219
221
|
update: {
|
|
220
222
|
$addToSet: { collaborators: docSet.originalDoc.userId }
|
|
221
223
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrationService.d.ts","sourceRoot":"","sources":["../../src/services/MigrationService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MigrationService.d.ts","sourceRoot":"","sources":["../../src/services/MigrationService.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACnC;;;;;;;;OAQG;WACU,SAAS,CAAC,MAAM,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CA+ZtD"}
|