Change: Bookmark UI #115

This commit is contained in:
advplyr 2021-11-03 17:45:47 -05:00
parent 76f28971a9
commit 908b9da112
6 changed files with 115 additions and 95 deletions

View file

@ -170,7 +170,15 @@ class Db {
updateEntity(entityName, entity) {
var entityDb = this.getEntityDb(entityName)
return entityDb.update((record) => record.id === entity.id, () => entity).then((results) => {
var jsonEntity = entity
if (entity && entity.toJSON) {
jsonEntity = entity.toJSON()
} else {
console.log('Entity has no json', jsonEntity)
}
return entityDb.update((record) => record.id === entity.id, () => jsonEntity).then((results) => {
Logger.debug(`[DB] Updated entity ${entityName}: ${results.updated}`)
var arrayKey = this.getEntityArrayKey(entityName)
this[arrayKey] = this[arrayKey].map(e => {