Files
GKNB_MSTM071/Backend/elso gyakorlat/src/Application/users/command/deleteUserCommandHandler.js
T
2026-02-13 19:14:10 +01:00

14 lines
301 B
JavaScript

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;
}
}