Skip to content

Commit b66b23a

Browse files
authored
fix indent (#577)
1 parent 234d9c4 commit b66b23a

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

docs/hooks.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -586,38 +586,38 @@ Join related records.
586586
const { fastJoin } = require('feathers-hooks-common');
587587

588588
const postResolvers = {
589-
joins: {
590-
author: (...args) => async post => post.author = (await users.find({
591-
query: { id: post.userId },
592-
paginate: false
593-
}))[0],
589+
joins: {
590+
author: (...args) => async post => post.author = (await users.find({
591+
query: { id: post.userId },
592+
paginate: false
593+
}))[0],
594594

595-
starers: $select => async post => post.starers = await users.find({
595+
starers: $select => async post => post.starers = await users.find({
596596
query: { id: { $in: post.starIds }, $select: $select || ['name'] },
597-
paginate: false
598-
}),
599-
}
597+
paginate: false
598+
}),
599+
}
600600
};
601601

602602
const query = {
603-
author: true,
604-
starers: [['id', 'name']]
603+
author: true,
604+
starers: [['id', 'name']]
605605
};
606606

607607
module.exports = { after: {
608-
all: [ fastJoin(postResolvers, query) ],
608+
all: [ fastJoin(postResolvers, query) ],
609609
} };
610610

611611
// Original record
612612
[ { id: 1, body: 'John post', userId: 101, starIds: [102, 103, 104] } ]
613613

614614
// Result
615615
[ { id: 1,
616-
body: 'John post',
617-
userId: 101,
618-
starIds: [ 102, 103, 104 ],
619-
author: { id: 101, name: 'John' },
620-
starers: [ { name: 'Marshall' }, { name: 'Barbara' }, { name: 'Aubree' } ]
616+
body: 'John post',
617+
userId: 101,
618+
starIds: [ 102, 103, 104 ],
619+
author: { id: 101, name: 'John' },
620+
starers: [ { name: 'Marshall' }, { name: 'Barbara' }, { name: 'Aubree' } ]
621621
}]
622622

623623
```

0 commit comments

Comments
 (0)