Add author edit modal & remove from experimental

This commit is contained in:
advplyr 2022-03-14 18:53:49 -05:00
parent deea6702f0
commit 4c2ad3ede5
26 changed files with 344 additions and 131 deletions

View file

@ -64,6 +64,21 @@ class Author {
this.updatedAt = Date.now()
}
update(payload) {
var json = this.toJSON()
delete json.id
delete json.addedAt
delete json.updatedAt
var hasUpdates = false
for (const key in json) {
if (payload[key] !== undefined && json[key] != payload[key]) {
this[key] = payload[key]
hasUpdates = true
}
}
return hasUpdates
}
checkNameEquals(name) {
if (!name) return false
return this.name.toLowerCase() == name.toLowerCase().trim()