mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-18 01:44:33 +02:00
Update:Create & update API endpoints to create with new data model
This commit is contained in:
parent
1b914d5d4f
commit
5308fd8b46
6 changed files with 184 additions and 70 deletions
|
@ -359,7 +359,7 @@ class Database {
|
|||
* @param {string} username
|
||||
* @param {string} pash
|
||||
* @param {Auth} auth
|
||||
* @returns {boolean} true if created
|
||||
* @returns {Promise<boolean>} true if created
|
||||
*/
|
||||
async createRootUser(username, pash, auth) {
|
||||
if (!this.sequelize) return false
|
||||
|
@ -379,17 +379,6 @@ class Database {
|
|||
return this.models.setting.updateSettingObj(settings.toJSON())
|
||||
}
|
||||
|
||||
async createUser(oldUser) {
|
||||
if (!this.sequelize) return false
|
||||
await this.models.user.createFromOld(oldUser)
|
||||
return true
|
||||
}
|
||||
|
||||
updateUser(oldUser) {
|
||||
if (!this.sequelize) return false
|
||||
return this.models.user.updateFromOld(oldUser)
|
||||
}
|
||||
|
||||
updateBulkBooks(oldBooks) {
|
||||
if (!this.sequelize) return false
|
||||
return Promise.all(oldBooks.map((oldBook) => this.models.book.saveFromOld(oldBook)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue