fix(admin): await user.save() without callback in createAdmin
Release / build-and-push (push) Successful in 1m14s
Release / build-and-push (push) Successful in 1m14s
Mongoose 7 removed callback support on Model.prototype.save(), so the seeder threw 'no longer accepts a callback' on every boot (caught and logged, non-fatal, but noisy and the success path never ran). Await the promise and log on success.
This commit is contained in:
@@ -33,12 +33,8 @@ const createAdmin = async () => {
|
||||
gamesToAccess: [],
|
||||
})
|
||||
|
||||
await user.save((err) => {
|
||||
console.log('Admin user successfully created')
|
||||
if (err) {
|
||||
return console.error('Could not save admin user')
|
||||
}
|
||||
})
|
||||
await user.save()
|
||||
console.log('Admin user successfully created')
|
||||
} catch (err) {
|
||||
return console.error(
|
||||
'Server Error: Could not create admin user' + err.message
|
||||
|
||||
Reference in New Issue
Block a user