Sort updated on Scenarios
This commit is contained in:
@@ -129,9 +129,13 @@ const getPage = async ( model, filter, page, populates, select ) => {
|
||||
const get = async (model, filter, select, skip, limit, populates, reply) => {
|
||||
var sort = {};
|
||||
var modelAttributes = Object.keys(model.schema.tree);
|
||||
if ( modelAttributes.indexOf("updated") !== -1) {
|
||||
sort.updated = -1;
|
||||
|
||||
if ( model === Scenario ) {
|
||||
if ( modelAttributes.indexOf("updated") !== -1) {
|
||||
sort.updated = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( modelAttributes.indexOf("created") !== -1) {
|
||||
sort.created = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user