fix(web-client-tpos): fix kitchen/recipes BFF routes — SPA fallback intercepted short routes
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.
This commit is contained in:
@@ -529,9 +529,8 @@ public class PosDataService
|
||||
public async Task<List<KitchenTicketInfo>> 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<List<KitchenTicketInfo>>(url, _jsonOptions) ?? new();
|
||||
}
|
||||
|
||||
@@ -548,7 +547,8 @@ public class PosDataService
|
||||
public async Task<List<RecipeInfo>> 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<List<RecipeInfo>>(url, _jsonOptions) ?? new();
|
||||
}
|
||||
|
||||
|
||||
@@ -1682,8 +1682,8 @@ public class BffDataController : ControllerBase
|
||||
|
||||
// ═══ KITCHEN TICKETS (fnb_engine) ═══
|
||||
|
||||
[HttpGet("kitchen/tickets")]
|
||||
public async Task<IActionResult> GetKitchenTickets([FromQuery] Guid? shopId = null, [FromQuery] string status = "pending")
|
||||
[HttpGet("shops/{shopId}/kitchen-tickets")]
|
||||
public async Task<IActionResult> GetKitchenTickets(Guid shopId, [FromQuery] string status = "pending")
|
||||
{
|
||||
var merchantId = await GetCurrentMerchantIdAsync();
|
||||
if (merchantId == null) return Ok(Array.Empty<object>());
|
||||
@@ -1726,8 +1726,8 @@ public class BffDataController : ControllerBase
|
||||
|
||||
// ═══ RECIPES CRUD (catalog_service) ═══
|
||||
|
||||
[HttpGet("recipes")]
|
||||
public async Task<IActionResult> GetRecipes([FromQuery] Guid? shopId = null)
|
||||
[HttpGet("shops/{shopId}/recipes")]
|
||||
public async Task<IActionResult> GetRecipes(Guid shopId)
|
||||
{
|
||||
var merchantId = await GetCurrentMerchantIdAsync();
|
||||
if (merchantId == null) return Ok(Array.Empty<object>());
|
||||
|
||||
Reference in New Issue
Block a user