Skip to content

Commit 0758880

Browse files
committed
Quick hack for user saves, see #220
1 parent d68a86c commit 0758880

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

js/utilities/galapagos.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ var db = new PouchDB(PouchDBUrl)
1010

1111
module.exports = exports = {
1212
isEntity: function (e) {
13+
// TODO check for userID, too. Or make the accounts regular.
14+
if (e.userId) {
15+
e.id = e.userId
16+
}
1317
if (e === null || typeof e !== 'object') throw new TypeError('Entity is not an object')
1418
if (e !== null && !e.id) throw new Error('Entity does not have an id')
1519
if (e !== null && typeof e.id !== 'string') throw new TypeError('Entity id is not a string')

0 commit comments

Comments
 (0)