diff --git a/packages/backend/src/interactions/services/interactionsCreator.service.spec.ts b/packages/backend/src/interactions/services/interactionsCreator.service.spec.ts index d25835a902..03eb7cf3ab 100644 --- a/packages/backend/src/interactions/services/interactionsCreator.service.spec.ts +++ b/packages/backend/src/interactions/services/interactionsCreator.service.spec.ts @@ -67,14 +67,19 @@ describe("interactionsCreator", () => { structureId: 1, }); - // Reset les courriers - usager.lastInteraction = { - dateInteraction: new Date(MOCKED_LAST_INTERACTION_DATE), - enAttente: false, - courrierIn: 0, - recommandeIn: 0, - colisIn: 0, - }; + await usagerRepository.update( + { uuid: usager.uuid }, + { + lastInteraction: { + dateInteraction: new Date(MOCKED_LAST_INTERACTION_DATE), + enAttente: false, + courrierIn: 0, + recommandeIn: 0, + colisIn: 0, + }, + } + ); + usager = await usagerRepository.findOneBy({ uuid: usager.uuid }); // Usager pour tester le "npai" await usagerRepository.update( diff --git a/packages/backend/src/usagers/controllers/usagers.controller.ts b/packages/backend/src/usagers/controllers/usagers.controller.ts index 07c5556c76..1df669f94d 100644 --- a/packages/backend/src/usagers/controllers/usagers.controller.ts +++ b/packages/backend/src/usagers/controllers/usagers.controller.ts @@ -279,13 +279,14 @@ export class UsagersController { @Param("usagerRef", new ParseIntPipe()) _usagerRef: number, @CurrentUsager() currentUsager: Usager ): Promise { + currentUsager.etapeDemande = etapeDemande; await usagerRepository.update( { uuid: currentUsager.uuid }, { etapeDemande, } ); - return { ...currentUsager, etapeDemande }; + return currentUsager; } @UseGuards(UsagerAccessGuard)