feat: add POST /api/v1/installation/users to seed user
This commit is contained in:
@@ -373,6 +373,19 @@ class User extends Base {
|
||||
return apps;
|
||||
}
|
||||
|
||||
static async createAdminUser({ email, password, fullName }) {
|
||||
const adminRole = await Role.findAdmin();
|
||||
|
||||
const adminUser = await this.query().insert({
|
||||
email,
|
||||
password,
|
||||
fullName,
|
||||
roleId: adminRole.id
|
||||
});
|
||||
|
||||
return adminUser;
|
||||
}
|
||||
|
||||
async $beforeInsert(queryContext) {
|
||||
await super.$beforeInsert(queryContext);
|
||||
|
||||
|
Reference in New Issue
Block a user