Lists and Templates overviews refactored to use ajax. Before the refactoring, they behaved and looked a bit different to the other (Ajax) tables. The main difference in the behavior was in the row numbers (1st column) when sort order was switched. The non-ajax tables rearranged the numbers in the 1st column while the ajax-tables didn't.
Some small tweaks in table-helpers to allow selecting which fields are pulled from DB (and how they are renamed).
This commit is contained in:
parent
e5190c9b20
commit
9fdf52674e
12 changed files with 246 additions and 192 deletions
|
@ -21,7 +21,7 @@ module.exports.list = (listId, start, limit, callback) => {
|
|||
return callback(new Error('Missing List ID'));
|
||||
}
|
||||
|
||||
tableHelpers.list('subscription__' + listId, 'email', start, limit, (err, rows, total) => {
|
||||
tableHelpers.list('subscription__' + listId, ['*'], 'email', start, limit, (err, rows, total) => {
|
||||
if (!err) {
|
||||
rows = rows.map(row => tools.convertKeys(row));
|
||||
}
|
||||
|
@ -80,10 +80,10 @@ module.exports.filter = (listId, request, columns, segmentId, callback) => {
|
|||
return callback(err);
|
||||
}
|
||||
|
||||
tableHelpers.filter('subscription__' + listId, request, columns, ['email', 'first_name', 'last_name'], 'email ASC', queryData, callback);
|
||||
tableHelpers.filter('subscription__' + listId, ['*'], request, columns, ['email', 'first_name', 'last_name'], 'email ASC', queryData, callback);
|
||||
});
|
||||
} else {
|
||||
tableHelpers.filter('subscription__' + listId, request, columns, ['email', 'first_name', 'last_name'], 'email ASC', null, callback);
|
||||
tableHelpers.filter('subscription__' + listId, ['*'], request, columns, ['email', 'first_name', 'last_name'], 'email ASC', null, callback);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue