Vulcan/packages/framework-demo/lib/parameters.js
2017-01-08 18:15:07 +09:00

16 lines
No EOL
394 B
JavaScript

/*
Add a new parameter callback that sorts movies by 'createdAt' property.
We use a callback instead of defining the sort in the resolver so that
the same sort can be used on the client, too.
*/
import { addCallback } from 'meteor/nova:core';
function sortByCreatedAt (parameters, terms) {
return {options: {sort: {createdAt: -1}}};
}
addCallback("movies.parameters", sortByCreatedAt);