WIP - fix displaying name for owner field
This commit is contained in:
@@ -39,7 +39,7 @@ export class SetupUsersController {
|
||||
@Post()
|
||||
async createUser(
|
||||
@TenantId() tenantId: string,
|
||||
@Body() data: { email: string; password: string; firstName?: string; lastName?: string },
|
||||
@Body() data: { email: string; password: string; firstName?: string; lastName?: string; alias?: string },
|
||||
) {
|
||||
const resolvedTenantId = await this.tenantDbService.resolveTenantId(tenantId);
|
||||
const knex = await this.tenantDbService.getTenantKnexById(resolvedTenantId);
|
||||
@@ -52,6 +52,7 @@ export class SetupUsersController {
|
||||
password: hashedPassword,
|
||||
firstName: data.firstName,
|
||||
lastName: data.lastName,
|
||||
alias: data.alias,
|
||||
isActive: true,
|
||||
});
|
||||
|
||||
@@ -62,7 +63,7 @@ export class SetupUsersController {
|
||||
async updateUser(
|
||||
@TenantId() tenantId: string,
|
||||
@Param('id') id: string,
|
||||
@Body() data: { email?: string; password?: string; firstName?: string; lastName?: string },
|
||||
@Body() data: { email?: string; password?: string; firstName?: string; lastName?: string; alias?: string },
|
||||
) {
|
||||
const resolvedTenantId = await this.tenantDbService.resolveTenantId(tenantId);
|
||||
const knex = await this.tenantDbService.getTenantKnexById(resolvedTenantId);
|
||||
@@ -72,6 +73,7 @@ export class SetupUsersController {
|
||||
if (data.email) updateData.email = data.email;
|
||||
if (data.firstName !== undefined) updateData.firstName = data.firstName;
|
||||
if (data.lastName !== undefined) updateData.lastName = data.lastName;
|
||||
if (data.alias !== undefined) updateData.alias = data.alias;
|
||||
|
||||
// Hash password if provided
|
||||
if (data.password) {
|
||||
|
||||
Reference in New Issue
Block a user