mirror of
https://github.com/dadosfera/maestro.git
synced 2026-08-31 19:58:21 +00:00
FEAT: resend invite
This commit is contained in:
Generated
+7
-7
@@ -36,7 +36,7 @@
|
||||
"passport-hubspot-oauth2": "^1.0.3",
|
||||
"passport-mailchimp": "^1.1.0",
|
||||
"protospack": "2.5.2",
|
||||
"protospack-v2": "3.9.0-beta.5",
|
||||
"protospack-v2": "3.9.0-beta.7",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.5.5",
|
||||
@@ -9015,9 +9015,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/protospack-v2": {
|
||||
"version": "3.9.0-beta.5",
|
||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/protospack-v2/-/protospack-v2-3.9.0-beta.5.tgz",
|
||||
"integrity": "sha512-rCoG+vWL2EF8r7nmvpdMKL3b2h98wDXaeXgBVK+BH0Lh+M3qwUfRpgt7FFQwk8zajfLOaPo6GZu4zOu+TCq0Eg==",
|
||||
"version": "3.9.0-beta.7",
|
||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/protospack-v2/-/protospack-v2-3.9.0-beta.7.tgz",
|
||||
"integrity": "sha512-QZqFz0Kc5pgcHOhNs4O6JG2kMZKDvY+7RwEdniRfb75ZSy/7BRJXLJUzB7Kjj1poIUM12n+gUg3kj3n00Gwegg==",
|
||||
"dependencies": {
|
||||
"@grpc/grpc-js": "^1.6.7",
|
||||
"rxjs": "^7.5.5",
|
||||
@@ -17245,9 +17245,9 @@
|
||||
}
|
||||
},
|
||||
"protospack-v2": {
|
||||
"version": "3.9.0-beta.5",
|
||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/protospack-v2/-/protospack-v2-3.9.0-beta.5.tgz",
|
||||
"integrity": "sha512-rCoG+vWL2EF8r7nmvpdMKL3b2h98wDXaeXgBVK+BH0Lh+M3qwUfRpgt7FFQwk8zajfLOaPo6GZu4zOu+TCq0Eg==",
|
||||
"version": "3.9.0-beta.7",
|
||||
"resolved": "https://dadosfera-611330257153.d.codeartifact.us-east-1.amazonaws.com:443/npm/dadosfera-npm/protospack-v2/-/protospack-v2-3.9.0-beta.7.tgz",
|
||||
"integrity": "sha512-QZqFz0Kc5pgcHOhNs4O6JG2kMZKDvY+7RwEdniRfb75ZSy/7BRJXLJUzB7Kjj1poIUM12n+gUg3kj3n00Gwegg==",
|
||||
"requires": {
|
||||
"@grpc/grpc-js": "^1.6.7",
|
||||
"rxjs": "^7.5.5",
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
"passport-hubspot-oauth2": "^1.0.3",
|
||||
"passport-mailchimp": "^1.1.0",
|
||||
"protospack": "2.5.2",
|
||||
"protospack-v2": "3.9.0-beta.5",
|
||||
"protospack-v2": "3.9.0-beta.7",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^7.5.5",
|
||||
|
||||
@@ -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