working crud

This commit is contained in:
sbriat
2023-02-08 15:06:49 +01:00
parent 4e1fb9a8d6
commit 368ce98174
8 changed files with 108 additions and 27 deletions

View File

@@ -18,16 +18,14 @@ export class UpdateTerritoryUseCase {
) {}
async execute(command: UpdateTerritoryCommand): Promise<Territory> {
const entity = this._mapper.map(
command.updateTerritoryRequest,
UpdateTerritoryRequest,
Territory,
);
try {
const territory = await this._repository.update(
const territory = await this._repository.updateTerritory(
command.updateTerritoryRequest.uuid,
entity,
this._mapper.map(
command.updateTerritoryRequest,
UpdateTerritoryRequest,
Territory,
),
);
this._territoryMessager.publish(
'update',