From 14c24a51a4b815e0bca426dc1a93e5d5d8fa263f Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Mon, 5 Oct 2026 18:14:00 +0200 Subject: [PATCH] =?UTF-8?q?fix(cards):=20respond=20renvoie=20200=20(plus?= =?UTF-8?q?=20201)=20pour=20l=E2=80=99ack=20front?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le front n’acceptait que HTTP 200 ; Nest POST répondait 201 → snackbar d’erreur alors que l’ack/accept était bien persisté. Front: tolère 200|201. Co-authored-by: Cursor --- backend/src/modules/cards/cards.controller.ts | 2 ++ frontend/lib/services/api/cards_service.dart | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/modules/cards/cards.controller.ts b/backend/src/modules/cards/cards.controller.ts index ce1e599..d1cfe21 100644 --- a/backend/src/modules/cards/cards.controller.ts +++ b/backend/src/modules/cards/cards.controller.ts @@ -79,8 +79,10 @@ export class CardsController { @Post(':id/respond') @Roles(RoleType.PARENT, RoleType.ASSISTANTE_MATERNELLE) + @HttpCode(HttpStatus.OK) @ApiOperation({ summary: 'Répondre (accept / refuse / ack) — #194' }) @ApiBody({ type: RepondreCarteDto }) + @ApiResponse({ status: 200, type: CarteDto }) repondre( @User('id') userId: string, @User('role') role: RoleType, diff --git a/frontend/lib/services/api/cards_service.dart b/frontend/lib/services/api/cards_service.dart index 14f64f9..8ce8c01 100644 --- a/frontend/lib/services/api/cards_service.dart +++ b/frontend/lib/services/api/cards_service.dart @@ -75,7 +75,7 @@ class CardsService { }), ); - if (response.statusCode != 200) { + if (response.statusCode != 200 && response.statusCode != 201) { throw Exception( _extractError(response.body, 'Erreur lors de la réponse'), );