From e223a8e949e3a926c8c971290f2df44ee76e8453 Mon Sep 17 00:00:00 2001 From: Dominic Rico-Gomez Date: Wed, 11 Apr 2018 18:09:46 +0200 Subject: [PATCH] add bool to detect if model got found or is newly created --- lib/offshore/query/composite.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/offshore/query/composite.js b/lib/offshore/query/composite.js index 6bb9c26c8..7761b9c27 100644 --- a/lib/offshore/query/composite.js +++ b/lib/offshore/query/composite.js @@ -69,7 +69,7 @@ module.exports = { // Return an instance of Model var model = new self._model(results); - return cb(null, model); + return cb(null, model, false); } // Create a new record if nothing is found. @@ -81,7 +81,7 @@ module.exports = { q2.exec(function(err, result) { if (err) return cb(err); - return cb(null, result); + return cb(null, result, true); }); }); }