mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-05 00:39:07 +00:00
FEAT: resend invite
This commit is contained in:
@@ -4,6 +4,8 @@ import {
|
||||
Delete,
|
||||
Get,
|
||||
Headers,
|
||||
HttpCode,
|
||||
HttpStatus,
|
||||
Inject,
|
||||
Param,
|
||||
Patch,
|
||||
@@ -157,6 +159,19 @@ export class UsersController {
|
||||
return await this.userService.batchCreateUser(body);
|
||||
}
|
||||
|
||||
@Post(':id')
|
||||
@RequireAllPermissions(PERMISSIONS.USERS.permissions.ADMIN)
|
||||
@HttpCode(HttpStatus.OK)
|
||||
async resendInvite(
|
||||
@User() user: RequestUser,
|
||||
@Param('id') id: string,
|
||||
@Headers('dadosfera-lang') language,
|
||||
) {
|
||||
this.logger.info('resendInvite', { user });
|
||||
this.userService.setLanguage(language);
|
||||
return this.userService.resendInvite({ id });
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@RequireAllPermissions(PERMISSIONS.USERS.permissions.ADMIN)
|
||||
@ApiOkResponse({ type: DeleteUserRes })
|
||||
|
||||
@@ -127,6 +127,7 @@ export class UsersService implements OnModuleInit {
|
||||
this.adjustUsersPayload([user]);
|
||||
return { user };
|
||||
}
|
||||
|
||||
async batchCreateUser({ users }: BatchCreateUserReq) {
|
||||
const usersToCreate: UserCreateRequest[] = users.map(
|
||||
({ roleNames, email, department, hierarchy, jobTitle, name }) => ({
|
||||
@@ -155,6 +156,11 @@ export class UsersService implements OnModuleInit {
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
async resendInvite(body: IdRequest) {
|
||||
return lastValueFrom(this.usersClientService.UserResendInvite(body));
|
||||
}
|
||||
|
||||
async assignRoleToUser(body: AssignRoleToUserRequest) {
|
||||
return lastValueFrom(this.usersClientService.AssignRoleToUser(body));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user