Skip to content

Instantly share code, notes, and snippets.

View SylvainEstevez's full-sized avatar
🚀

Sylvain Estevez SylvainEstevez

🚀
View GitHub Profile
const tokenFieldsWeights = {
id: 100,
dependency_id: 80,
task_id: 80,
actor_id: 60,
actor_owner_id: 40,
actor_owner_type: 30
actor_type: 20
};
@SylvainEstevez
SylvainEstevez / deep-filtering.js
Last active July 6, 2016 23:52
Real life example of deep filtering
class TransactionsResource extends Restypie.Resources.SequelizeResource {
get schema() {
return {
id: { type: String, isPrimaryKey: true, isFilterable: true },
tasks: {
type: Restypie.Fields.ToManyField,
to() { return api.resources.tasks; },
toKey: 'transaction_id',
isFilterable: true,
filteringStrategy: FilteringStrategies.BottomToTop // Will first filter tasks to get transaction ids and apply those to the filters