From 12a2d21528ba0760596f1ec3c4cfa2364069f5c2 Mon Sep 17 00:00:00 2001 From: jakeorr Date: Fri, 4 Jun 2021 15:20:22 -0700 Subject: [PATCH] pull out decoded ID for hashedFields --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index e295d32..783af23 100644 --- a/index.js +++ b/index.js @@ -77,7 +77,7 @@ module.exports = Model => { this.constructor.hashedFields.forEach(field => { const hashId = get(json, field) const decoded = this.constructor._hashIdInstance.decode(hashId) - set(json, field, decoded) + set(json, field, decoded[0]) }) // decoding the id is a bit trickier as it can be a compound PK.