Skip to content

Commit

Permalink
added eager query to get child chips of folder on get single folder
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueAccords committed Jun 3, 2018
1 parent 5e947ac commit bba7ce8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/controllers/folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ module.exports = {
},
get: async function(req, res) {
const id = req.params.id;
const folder = await Folder.query().findById(id);
const folder = await Folder.query()
.findById(id)
.eager('[author, child_chips]');
if(folder) {
ctrlHelpers.handleResponse(true, res, 200, 'success', folder);
} else {
Expand Down

0 comments on commit bba7ce8

Please sign in to comment.