backend feladat

This commit is contained in:
magdo
2026-02-13 19:14:10 +01:00
parent 6afdef6a30
commit 622d4a3321
877 changed files with 87856 additions and 0 deletions
@@ -0,0 +1,18 @@
export class UpdateUserCommandHandler {
constructor(userRepository) {
this.userRepository = userRepository;
}
async handle(command) {
const userData = {};
if (command.name) userData.name = command.name;
if (command.email) userData.email = command.email;
if (command.age !== undefined) userData.age = command.age;
const result = await this.userRepository.update(command.id, userData);
if (!result) {
throw new Error('User not found');
}
return result;
}
}