mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 07:40:32 +00:00
wip
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { UsersApplication } from './Users.application';
|
||||
import { InviteUserDto, SendInviteUserDto } from './dtos/InviteUser.dto';
|
||||
@@ -38,7 +38,7 @@ export class UsersInviteController {
|
||||
/**
|
||||
* Send an invitation to a new user.
|
||||
*/
|
||||
@Post()
|
||||
@Patch()
|
||||
@ApiOperation({ summary: 'Send an invitation to a new user.' })
|
||||
async sendInvite(@Body() sendInviteDTO: SendInviteUserDto) {
|
||||
const result = await this.usersApplication.sendInvite(sendInviteDTO);
|
||||
|
||||
@@ -18,7 +18,7 @@ export class EditUserService {
|
||||
private readonly tenantUserModel: TenantModelProxy<typeof TenantUser>,
|
||||
private readonly eventEmitter: EventEmitter2,
|
||||
private readonly tenancyContext: TenancyContext,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
/**
|
||||
* Creates a new user.
|
||||
@@ -52,7 +52,10 @@ export class EditUserService {
|
||||
const tenantUser = await this.tenantUserModel()
|
||||
.query()
|
||||
.updateAndFetchById(userId, {
|
||||
...editUserDTO,
|
||||
firstName: editUserDTO.firstName,
|
||||
lastName: editUserDTO.lastName,
|
||||
email: editUserDTO.email,
|
||||
roleId: editUserDTO.roleId,
|
||||
});
|
||||
// Triggers `onTenantUserEdited` event.
|
||||
await this.eventEmitter.emitAsync(events.tenantUser.onEdited, {
|
||||
|
||||
Reference in New Issue
Block a user