mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-23 20:59:08 +00:00
FEAT: block, unblock and reset users
This commit is contained in:
@@ -20,7 +20,7 @@ import {
|
||||
} from '@dadosfera/protospack-v2/dist/lib/Duc/interfaces/messages';
|
||||
import { DucClient } from '../duc/client.config';
|
||||
import { Metadata } from '@grpc/grpc-js';
|
||||
import { UserActionRequest, UserActionResponse } from './dtos/login';
|
||||
import { BulkEditResponse } from './dtos/login';
|
||||
|
||||
@Injectable()
|
||||
export class AuthClientService implements OnModuleInit {
|
||||
@@ -170,7 +170,7 @@ export class AuthClientService implements OnModuleInit {
|
||||
);
|
||||
}
|
||||
|
||||
async blockUsers(metadata: Metadata): Promise<UserActionResponse> {
|
||||
async blockUsers(users: string[],metadata: Metadata): Promise<BulkEditResponse> {
|
||||
this.logger.info('blockUsers - Service starting');
|
||||
|
||||
try {
|
||||
@@ -181,8 +181,8 @@ export class AuthClientService implements OnModuleInit {
|
||||
}
|
||||
});
|
||||
|
||||
const response = await lastValueFrom<UserActionResponse>(
|
||||
this.authService.BlockUser({}, metadata),
|
||||
const response = await lastValueFrom<BulkEditResponse>(
|
||||
this.authService.BlockUser({ users }, metadata),
|
||||
);
|
||||
|
||||
this.logger.info('blockUsers - Service success', { response });
|
||||
@@ -196,14 +196,14 @@ export class AuthClientService implements OnModuleInit {
|
||||
}
|
||||
}
|
||||
|
||||
async unblockUsers(metadata: Metadata): Promise<UserActionResponse> {
|
||||
async unblockUsers(users: string[],metadata: Metadata): Promise<BulkEditResponse> {
|
||||
this.logger.info('unblockUsers');
|
||||
return await lastValueFrom(
|
||||
this.authService.UnblockUser({}, metadata),
|
||||
this.authService.UnblockUser({ users }, metadata),
|
||||
);
|
||||
}
|
||||
|
||||
async resetUsers(metadata: Metadata): Promise<UserActionResponse> {
|
||||
async resetUsers(users: string[], metadata: Metadata): Promise<BulkEditResponse> {
|
||||
this.logger.info('resetUsers');
|
||||
|
||||
try {
|
||||
@@ -214,8 +214,8 @@ export class AuthClientService implements OnModuleInit {
|
||||
}
|
||||
});
|
||||
|
||||
const response = await lastValueFrom<UserActionResponse>(
|
||||
this.authService.ResetUser({}, metadata)
|
||||
const response = await lastValueFrom<BulkEditResponse>(
|
||||
this.authService.ResetUser({ users }, metadata)
|
||||
);
|
||||
|
||||
this.logger.info('resetUsers - Success', { response });
|
||||
|
||||
Reference in New Issue
Block a user