wip
This commit is contained in:
@@ -22,10 +22,12 @@ export class UpdateTeamUseCase {
|
||||
throw new Error('Team not found');
|
||||
}
|
||||
|
||||
const updated: Team = {
|
||||
...existing,
|
||||
...updates,
|
||||
};
|
||||
const updated = existing.update({
|
||||
...(updates.name !== undefined && { name: updates.name }),
|
||||
...(updates.tag !== undefined && { tag: updates.tag }),
|
||||
...(updates.description !== undefined && { description: updates.description }),
|
||||
...(updates.leagues !== undefined && { leagues: updates.leagues }),
|
||||
});
|
||||
|
||||
await this.teamRepository.update(updated);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user