@dnax/core 0.48.0 → 0.50.0
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/driver/mongo/rest.ts +6 -3
- package/lib/cron/index.ts +1 -1
- package/package.json +1 -2
package/driver/mongo/rest.ts
CHANGED
|
@@ -816,6 +816,7 @@ class useRest {
|
|
|
816
816
|
options?: Omit<optionCb, "elementAt">
|
|
817
817
|
): Promise<object | null> {
|
|
818
818
|
return new Promise(async (resolve, reject) => {
|
|
819
|
+
if (!id) reject("Id is required");
|
|
819
820
|
try {
|
|
820
821
|
let meta = {
|
|
821
822
|
total: 0,
|
|
@@ -1008,6 +1009,8 @@ class useRest {
|
|
|
1008
1009
|
return resolve(result);
|
|
1009
1010
|
}
|
|
1010
1011
|
|
|
1012
|
+
if (!id) reject("Id is required");
|
|
1013
|
+
|
|
1011
1014
|
//@ts-expect-error
|
|
1012
1015
|
update = omit(update, omitUpdate);
|
|
1013
1016
|
|
|
@@ -1339,7 +1342,7 @@ class useRest {
|
|
|
1339
1342
|
}
|
|
1340
1343
|
|
|
1341
1344
|
if (Array.isArray(ids)) {
|
|
1342
|
-
if (!ids?.length)
|
|
1345
|
+
if (!ids?.length) reject("Ids required");
|
|
1343
1346
|
|
|
1344
1347
|
await this.#tenant.database.db?.collection(collection).updateMany(
|
|
1345
1348
|
{
|
|
@@ -1419,7 +1422,6 @@ class useRest {
|
|
|
1419
1422
|
): Promise<object> {
|
|
1420
1423
|
return new Promise(async (resolve, reject) => {
|
|
1421
1424
|
try {
|
|
1422
|
-
if (!id) fn.error("Id is required", 400);
|
|
1423
1425
|
let useHook = options?.useHook ?? this.#useHook;
|
|
1424
1426
|
let useCustomApi = options?.useCustomApi ?? this.#useCustomApi;
|
|
1425
1427
|
|
|
@@ -1472,6 +1474,7 @@ class useRest {
|
|
|
1472
1474
|
});
|
|
1473
1475
|
return resolve(result!);
|
|
1474
1476
|
}
|
|
1477
|
+
if (!id) reject("Id is required");
|
|
1475
1478
|
|
|
1476
1479
|
let doc = await this.#tenant.database.db
|
|
1477
1480
|
?.collection(collection)
|
|
@@ -1582,7 +1585,7 @@ class useRest {
|
|
|
1582
1585
|
|
|
1583
1586
|
let deletedIds: any = ids || [];
|
|
1584
1587
|
|
|
1585
|
-
if (!ids)
|
|
1588
|
+
if (!ids) reject("Ids required");
|
|
1586
1589
|
|
|
1587
1590
|
if (Array.isArray(ids)) {
|
|
1588
1591
|
await this.#tenant.database.db?.collection(collection).deleteMany(
|
package/lib/cron/index.ts
CHANGED
|
@@ -20,7 +20,7 @@ async function initCron() {
|
|
|
20
20
|
let cronOpt = inject.default as cronConfig;
|
|
21
21
|
if (cronOpt?.enabled) {
|
|
22
22
|
let cronTask = new Cron(cronOpt.pattern, {
|
|
23
|
-
...cleanDeep(cronOpt
|
|
23
|
+
...cleanDeep(cronOpt?.options),
|
|
24
24
|
});
|
|
25
25
|
let cronTaskExec = cronOpt?.exec || cronOpt?.handler;
|
|
26
26
|
if (cronTaskExec && typeof cronTaskExec == "function") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dnax/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.0",
|
|
4
4
|
"module": "index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
"joi": "17.13.3",
|
|
42
42
|
"json-joy": "16.8.0",
|
|
43
43
|
"jsonwebtoken": "^9.0.2",
|
|
44
|
-
"libreoffice-convert": "^1.6.0",
|
|
45
44
|
"mime-types": "^2.1.35",
|
|
46
45
|
"mingo": "^6.5.0",
|
|
47
46
|
"moment": "^2.30.1",
|