adminforth 1.3.29 → 1.3.31
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/dataConnectors/mongo.ts +1 -1
- package/dist/dataConnectors/mongo.js +1 -1
- package/dist/index.js +4 -1
- package/index.ts +5 -2
- package/package.json +1 -1
package/dataConnectors/mongo.ts
CHANGED
|
@@ -42,7 +42,7 @@ class MongoConnector extends AdminForthBaseConnector implements IAdminForthDataS
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
async discoverFields(resource) {
|
|
45
|
-
return resource.columns.reduce((acc, col) => {
|
|
45
|
+
return resource.columns.filter((col) => !col.virtual).reduce((acc, col) => {
|
|
46
46
|
if (!col.type) {
|
|
47
47
|
throw new Error(`Type is not defined for column ${col.name} in resource ${resource.table}`);
|
|
48
48
|
}
|
|
@@ -46,7 +46,7 @@ class MongoConnector extends AdminForthBaseConnector {
|
|
|
46
46
|
}
|
|
47
47
|
discoverFields(resource) {
|
|
48
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
return resource.columns.reduce((acc, col) => {
|
|
49
|
+
return resource.columns.filter((col) => !col.virtual).reduce((acc, col) => {
|
|
50
50
|
if (!col.type) {
|
|
51
51
|
throw new Error(`Type is not defined for column ${col.name} in resource ${resource.table}`);
|
|
52
52
|
}
|
package/dist/index.js
CHANGED
|
@@ -249,8 +249,11 @@ class AdminForth {
|
|
|
249
249
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
250
250
|
throw new Error(`Hook afterSave must return object with {ok: true} or { error: 'Error' } `);
|
|
251
251
|
}
|
|
252
|
-
|
|
252
|
+
if (resp.error) {
|
|
253
|
+
return { error: resp.error };
|
|
254
|
+
}
|
|
253
255
|
}
|
|
256
|
+
return { error: null };
|
|
254
257
|
});
|
|
255
258
|
}
|
|
256
259
|
deleteResourceRecord(_b) {
|
package/index.ts
CHANGED
|
@@ -321,9 +321,12 @@ class AdminForth implements IAdminForth {
|
|
|
321
321
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
322
322
|
throw new Error(`Hook afterSave must return object with {ok: true} or { error: 'Error' } `);
|
|
323
323
|
}
|
|
324
|
-
|
|
325
|
-
|
|
324
|
+
if (resp.error) {
|
|
325
|
+
return { error: resp.error };
|
|
326
|
+
}
|
|
326
327
|
}
|
|
328
|
+
|
|
329
|
+
return { error: null };
|
|
327
330
|
}
|
|
328
331
|
|
|
329
332
|
async deleteResourceRecord(
|