Vulcan/packages/framework-demo/lib/parameters.js

16 lines
394 B
JavaScript
Raw Normal View History

2017-01-08 18:15:07 +09:00
/*
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);