From 6548b5babf5c621706708dc41dce9a3820e3c47f Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Wed, 4 Mar 2026 07:52:45 +0700 Subject: [PATCH] =?UTF-8?q?fix(web-client-tpos):=20fix=20kitchen/recipes?= =?UTF-8?q?=20BFF=20routes=20=E2=80=94=20SPA=20fallback=20intercepted=20sh?= =?UTF-8?q?ort=20routes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed BFF routes to use shops/{shopId}/ prefix pattern: - kitchen/tickets → shops/{shopId}/kitchen-tickets - recipes → shops/{shopId}/recipes Updated PosDataService client URLs to match. Added missing kitchen/recipes data loading cases in ShopPage. --- .../src/WebClientTpos.Client/Services/PosDataService.cs | 8 ++++---- .../WebClientTpos.Server/Controllers/BffDataController.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/web-client-tpos-net/src/WebClientTpos.Client/Services/PosDataService.cs b/apps/web-client-tpos-net/src/WebClientTpos.Client/Services/PosDataService.cs index 3811a174..501bd743 100644 --- a/apps/web-client-tpos-net/src/WebClientTpos.Client/Services/PosDataService.cs +++ b/apps/web-client-tpos-net/src/WebClientTpos.Client/Services/PosDataService.cs @@ -529,9 +529,8 @@ public class PosDataService public async Task> GetKitchenTicketsAsync(Guid? shopId = null, string status = "pending") { AttachToken(); - var url = shopId.HasValue - ? $"api/bff/kitchen/tickets?shopId={shopId}&status={status}" - : $"api/bff/kitchen/tickets?status={status}"; + if (!shopId.HasValue) return new(); + var url = $"api/bff/shops/{shopId}/kitchen-tickets?status={status}"; return await _http.GetFromJsonAsync>(url, _jsonOptions) ?? new(); } @@ -548,7 +547,8 @@ public class PosDataService public async Task> GetRecipesAsync(Guid? shopId = null) { AttachToken(); - var url = shopId.HasValue ? $"api/bff/recipes?shopId={shopId}" : "api/bff/recipes"; + if (!shopId.HasValue) return new(); + var url = $"api/bff/shops/{shopId}/recipes"; return await _http.GetFromJsonAsync>(url, _jsonOptions) ?? new(); } diff --git a/apps/web-client-tpos-net/src/WebClientTpos.Server/Controllers/BffDataController.cs b/apps/web-client-tpos-net/src/WebClientTpos.Server/Controllers/BffDataController.cs index a430ea23..9c0f56d1 100644 --- a/apps/web-client-tpos-net/src/WebClientTpos.Server/Controllers/BffDataController.cs +++ b/apps/web-client-tpos-net/src/WebClientTpos.Server/Controllers/BffDataController.cs @@ -1682,8 +1682,8 @@ public class BffDataController : ControllerBase // ═══ KITCHEN TICKETS (fnb_engine) ═══ - [HttpGet("kitchen/tickets")] - public async Task GetKitchenTickets([FromQuery] Guid? shopId = null, [FromQuery] string status = "pending") + [HttpGet("shops/{shopId}/kitchen-tickets")] + public async Task GetKitchenTickets(Guid shopId, [FromQuery] string status = "pending") { var merchantId = await GetCurrentMerchantIdAsync(); if (merchantId == null) return Ok(Array.Empty()); @@ -1726,8 +1726,8 @@ public class BffDataController : ControllerBase // ═══ RECIPES CRUD (catalog_service) ═══ - [HttpGet("recipes")] - public async Task GetRecipes([FromQuery] Guid? shopId = null) + [HttpGet("shops/{shopId}/recipes")] + public async Task GetRecipes(Guid shopId) { var merchantId = await GetCurrentMerchantIdAsync(); if (merchantId == null) return Ok(Array.Empty());