mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
16 lines
394 B
JavaScript
16 lines
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);
|