@pxp-nd/core 1.2.3 → 1.2.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.
|
@@ -121,7 +121,6 @@ class Controller {
|
|
|
121
121
|
const permission = Reflect.getMetadata('permission', this.constructor) || {};
|
|
122
122
|
// get log
|
|
123
123
|
const log = Reflect.getMetadata('log', this.constructor) || {};
|
|
124
|
-
console.log('qqqqqqw', log);
|
|
125
124
|
// get dbsettings
|
|
126
125
|
const dbsettings = Reflect.getMetadata('dbsettings', this.constructor) || {};
|
|
127
126
|
// get logConfig
|
|
@@ -275,6 +274,7 @@ class Controller {
|
|
|
275
274
|
}
|
|
276
275
|
}
|
|
277
276
|
async list(params) {
|
|
277
|
+
console.log('lllleggaa en list');
|
|
278
278
|
const connection = typeorm_1.getConnection(process.env.DB_WRITE_CONNECTION_NAME);
|
|
279
279
|
const queryRunner = connection.getMetadata(this.model).ownColumns.find(column => column.isPrimary === true);
|
|
280
280
|
// ffp search if in the params has been sent the primary key
|
|
@@ -286,13 +286,16 @@ class Controller {
|
|
|
286
286
|
// filter by some column that exist in the entity
|
|
287
287
|
// ffp if some column is into of params for added in the condition
|
|
288
288
|
let ownColumnsForSchema = {};
|
|
289
|
+
console.log('connection.getMetadata(this.model).ownColumns', connection.getMetadata(this.model).ownColumns);
|
|
289
290
|
const whereOwnColumns = connection.getMetadata(this.model).ownColumns.reduce((t, column) => {
|
|
291
|
+
console.log('column.propertyName', column.propertyName);
|
|
290
292
|
if (`_${column.propertyName}` in params) {
|
|
291
293
|
ownColumnsForSchema = Object.assign(Object.assign({}, ownColumnsForSchema), { [`_${column.propertyName}`]: joi_1.default.string() });
|
|
292
294
|
t = Object.assign(Object.assign({}, t), { [column.propertyName]: params[`_${column.propertyName}`] });
|
|
293
295
|
}
|
|
294
296
|
return t;
|
|
295
297
|
}, {});
|
|
298
|
+
console.log('whereOwnColumns', whereOwnColumns);
|
|
296
299
|
const schema = this.getListSchema(ownColumnsForSchema);
|
|
297
300
|
const resParams = await index_1.__(this.schemaValidate(schema, params));
|
|
298
301
|
const listParam = this.getListParams(resParams, whereOwnColumns);
|