Skip to content

Commit

Permalink
_fields and _links showing
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanoff committed Aug 13, 2017
1 parent 62d31b3 commit 7912020
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions controllers/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ exports = module.exports = function (name, model) {
if (err) return req._error.show(err);
if (!docs || !docs[0]) return req._error.NOT_FOUND(name, search);

docs.forEach(function(doc) {
doc._links = _this.makeLinks(name, doc._id, req._relations);
});
if(!fields || fields._links) {
docs.forEach(function(doc) {
doc._links = _this.makeLinks(name, doc._id, req._relations);
})
}

res.json(docs);
});
Expand Down

0 comments on commit 7912020

Please sign in to comment.