From 50e03af2966b6a181318feeaccb0a8646c33831f Mon Sep 17 00:00:00 2001 From: Alexa <53471801+Alexa-RR@users.noreply.github.com> Date: Fri, 26 Jun 2026 19:25:25 +0300 Subject: [PATCH] feat: Add endpoint for ad carousel items returning an empty banner --- .../API/Store/StorefrontsController.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/DorkNet.Server/Controllers/API/Store/StorefrontsController.cs b/DorkNet.Server/Controllers/API/Store/StorefrontsController.cs index 6db6615..2a54ae6 100644 --- a/DorkNet.Server/Controllers/API/Store/StorefrontsController.cs +++ b/DorkNet.Server/Controllers/API/Store/StorefrontsController.cs @@ -33,7 +33,6 @@ public class StorefrontsController( [HttpGet("api/storefronts/v2/all")] [HttpGet("api/storefronts/v3/all")] [HttpGet("api/storefronts/v1/toptoday")] - [HttpGet("api/storefronts/v1/adcarouselitems")] [AllowAnonymous] public async Task All() { @@ -41,6 +40,20 @@ public class StorefrontsController( return Ok(items.Select(i => StoreService.ToItemDto(i, domain.Apex)).ToArray()); } + /// GET api/storefronts/v1/adcarouselitems — the rotating + /// promo banner at the top of the Shop, NOT the main catalog. The client + /// (AdCarouselItemListModel) keys these by AdCarouselItemId in a + /// Dictionary; our generic store DTOs don't carry that field, so every + /// row deserialised to id 0 and the SECOND item threw + /// "An item with the same key has already been added. Key: 0", + /// which surfaced as an unobserved task exception that broke the Shop. + /// We don't run promo carousels, so return an empty banner — the real + /// catalog still comes from /all + /skus. (To add a real carousel later, + /// emit one row per item with a UNIQUE AdCarouselItemId.) + [HttpGet("api/storefronts/v1/adcarouselitems")] + [AllowAnonymous] + public IActionResult AdCarouselItems() => Ok(Array.Empty()); + /// GET api/storefronts/v3/skus — alias for the full /// catalog. Some 2020 client paths call this instead of /all /// during the watch's "browse all SKUs" flow.