mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 12:36:39 -04:00
19 lines
No EOL
461 B
JavaScript
19 lines
No EOL
461 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 {
|
|
selector: parameters.selector,
|
|
options: {...parameters.options, sort: {createdAt: -1}}
|
|
};
|
|
}
|
|
|
|
addCallback("movies.parameters", sortByCreatedAt); |