Use transaction and check root on server init

This commit is contained in:
advplyr committed 2026-10-04 20:03:56 -05:00
1 parent 2a0507ffc6
commit 34715558df
3 files changed
+22 -6

No files matched your search

+2 -2
View File
@@ -189,7 +189,7 @@ class User extends Model {
* @param {import('../Auth')} auth
* @returns {Promise<User>}
*/
static async createRootUser(username, pash, auth) {
static async createRootUser(username, pash, auth, transaction = null) {
const userId = uuidv4()
const token = auth.generateAccessToken({ id: userId, username })
@@ -207,7 +207,7 @@ class User extends Model {
seriesHideFromContinueListening: []
}
}
return this.create(newUser)
return this.create(newUser, { transaction })
}
/**