Strip unnecessary keys for saving

This commit is contained in:
janherich 2018-05-04 01:34:13 +02:00 committed by Roman Volosovskyi
parent 00b8ae311d
commit 504b0be251
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
1 changed files with 3 additions and 1 deletions

View File

@ -131,7 +131,9 @@
([realm schema-name obj] ([realm schema-name obj]
(create realm schema-name obj false)) (create realm schema-name obj false))
([realm schema-name obj update?] ([realm schema-name obj update?]
(.create realm (name schema-name) (clj->js obj) update?))) (let [obj-to-save (select-keys obj (keys (get-in entity->schemas
[schema-name :properties])))]
(.create realm (name schema-name) (clj->js obj-to-save) update?))))
(defn save (defn save
([realm schema-name obj] ([realm schema-name obj]