adminizer 4.1.0-build.3 → 4.1.0-build.4
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/lib/Adminizer.d.ts
CHANGED
package/lib/Adminizer.js
CHANGED
|
@@ -58,6 +58,21 @@ export class Adminizer {
|
|
|
58
58
|
this._emitter = new EventEmitter();
|
|
59
59
|
this.ormAdapters = ormAdapters;
|
|
60
60
|
}
|
|
61
|
+
getMiddleware() {
|
|
62
|
+
return (req, res) => {
|
|
63
|
+
this.app(req, res, (err) => {
|
|
64
|
+
if (err) {
|
|
65
|
+
console.log("Error in Adminizer", err);
|
|
66
|
+
res.writeHead(500, { 'Content-Type': 'text/plain' });
|
|
67
|
+
res.end('Internal Server Error');
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
|
71
|
+
res.end('Route Not Found in Adminizer');
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
}
|
|
61
76
|
/**
|
|
62
77
|
* Vite middleware
|
|
63
78
|
* @protected
|
|
@@ -42,7 +42,7 @@ function resolveType(type) {
|
|
|
42
42
|
}
|
|
43
43
|
/** SequelizeModel — реализация модели, совместимая с AbstractModel */
|
|
44
44
|
function convertCriteriaToSequelize(criteria) {
|
|
45
|
-
console.
|
|
45
|
+
console.debug("waterline criteria", criteria);
|
|
46
46
|
const result = {};
|
|
47
47
|
for (const key in criteria) {
|
|
48
48
|
const value = criteria[key];
|
|
@@ -80,7 +80,7 @@ function convertCriteriaToSequelize(criteria) {
|
|
|
80
80
|
return result;
|
|
81
81
|
}
|
|
82
82
|
function convertWaterlineCriteriaToSequelizeOptions(criteria) {
|
|
83
|
-
console.
|
|
83
|
+
console.debug("WATERLINE CRITERIA", criteria);
|
|
84
84
|
const { where = {}, skip, limit, sort } = criteria;
|
|
85
85
|
const result = {
|
|
86
86
|
where: convertCriteriaToSequelize(where),
|