From 2cbe974e3f43c4101971434470b8b83f4f5c7a6b Mon Sep 17 00:00:00 2001 From: Joe K Date: Thu, 25 Mar 2021 16:20:33 -0400 Subject: [PATCH] copy --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index ed7faee..3f7e565 100644 --- a/index.js +++ b/index.js @@ -169,6 +169,10 @@ function removeDuplicateRecords(collection) { */ function jsonapify(data, model, selfUrl, context) { const includedData = []; + if (model.attributes === undefined) { + model.attributes = model.rawAttributes; + } + const idAttribute = Object.keys(model.attributes).filter(byPrimaryKey(model))[0]; const excluded = [idAttribute];