Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Sylvain Estevez SylvainEstevez

🎯
Focusing
View GitHub Profile
View weights.js
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 Jul 6, 2016
Real life example of deep filtering
View deep-filtering.js
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