Skip to content

Commit

Permalink
Update guides.md (#616)
Browse files Browse the repository at this point in the history
The current code causes error, since it tries to access other service which is not defined in the service.
Only changes main fastJoin example, everything else might need some review.
  • Loading branch information
laurensiusadi committed Feb 9, 2021
1 parent c2d8d7a commit c5b7157
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ const { fastJoin } = require('feathers-hooks-common')

const postResolvers = {
joins: {
author: (...args) => async post => {
author: (...args) => async (post, { app }) => {
post.author = (
await users.find({
await app.services('users').find({
query: {
id: post.userId
}
})
)[0]
},

starers: $select => async post => {
post.starers = await users.find({
starers: $select => async (post, { app }) => {
post.starers = await app.services('users').find({
query: {
id: { $in: post.starIds },
$select: $select || ['name']
Expand Down

0 comments on commit c5b7157

Please sign in to comment.