pangea-server 1.0.46 → 1.0.48
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.
|
@@ -84,7 +84,6 @@ class Db {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
const deletedAtWhere = paranoid === 'deleted' ? { deletedAt: { [_1.Ops.not]: null } } : {};
|
|
87
|
-
console.log(getFinalAttributes(attributes));
|
|
88
87
|
return {
|
|
89
88
|
attributes: getFinalAttributes(attributes),
|
|
90
89
|
...getIncludeAndWhere(model, include, { ...where, ...searchWhere, ...deletedAtWhere }),
|
|
@@ -191,15 +190,22 @@ exports.Db = Db;
|
|
|
191
190
|
function getFinalAttributes(attributes) {
|
|
192
191
|
if (!attributes)
|
|
193
192
|
return;
|
|
194
|
-
|
|
193
|
+
const attt = attributes.map((attribute) => {
|
|
194
|
+
console.log('attribute: ', attribute);
|
|
195
195
|
if (typeof attribute === 'string')
|
|
196
196
|
return [(0, sequelize_1.col)((0, pangea_helpers_1.camelToSnake)(attribute)), attribute];
|
|
197
|
+
console.log('--- [alias, column] --- ');
|
|
197
198
|
const [alias, column] = Object.entries(attribute)[0];
|
|
199
|
+
console.log(alias, ': ', column);
|
|
198
200
|
if (typeof column === 'string')
|
|
199
201
|
return [(0, sequelize_1.col)((0, pangea_helpers_1.camelToSnake)(column)), alias];
|
|
202
|
+
console.log('--- [op, field] --- ');
|
|
200
203
|
const [op, field] = column;
|
|
204
|
+
console.log(op, ': ', field);
|
|
201
205
|
return [(0, sequelize_1.fn)(op, (0, sequelize_1.col)(field)), alias];
|
|
202
206
|
});
|
|
207
|
+
console.log('attt: ', attt);
|
|
208
|
+
return attt;
|
|
203
209
|
}
|
|
204
210
|
function convertWhereKeys(obj) {
|
|
205
211
|
if (Array.isArray(obj)) {
|