backend feladat
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
export class DeleteUserCommandHandler {
|
||||
constructor(userRepository) {
|
||||
this.userRepository = userRepository;
|
||||
}
|
||||
|
||||
async handle(command) {
|
||||
const result = await this.userRepository.delete(command.id);
|
||||
if (!result) {
|
||||
throw new Error('User not found');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user