v3: fix iap url

This commit is contained in:
Matteo Pagliazzi
2016-05-19 20:44:44 +02:00
parent 0a14d29ebb
commit c8f55302ca
3 changed files with 5 additions and 4 deletions

View File

@@ -60,6 +60,9 @@ module.exports = function baseModel (schema, options = {}) {
objectPath.del(plainObj, fieldPath);
});
// Always return `id`
if (!plainObj.id && plainObj._id) plainObj.id = plainObj._id;
// Allow an additional toJSON transform function to be used
return options.toJSONTransform ? options.toJSONTransform(plainObj, doc) : plainObj;
};