Support #11811
openSupport #11764: E-commerce pending tasks for nov 15 release
Remove unwanted api calls in home page
100%
Description
https://atlantafencecompany.co/api/v1/nus-order/coupon/published?slug=nursery%2Fevergreen - Not required to called in home page
https://atlantafencecompany.co/api/v1/nus-shop/welcome-coupon?slug=nursery%2Fevergreen - Not required to called in home page
1.https://atlantafencecompany.co/api/v1/growth/local-merch-context?slug=nursery%2Fevergreen&country=IN&city=Vijayawada&location=Vijayawada&lat=16.51667&lng=80.61667
2.https://atlantafencecompany.co/api/v1/growth/weather-products?slug=nursery%2Fevergreen&sessionId=sess_1793270511005_9qoktj90&variant=treatment&lat=16.51667&lng=80.61667&city=Vijayawada&tz=Asia%2FCalcutta
3.https://atlantafencecompany.co/api/v1/growth/seasonal-products?slug=nursery%2Fevergreen&limit=18&country=IN&city=Vijayawada&location=Vijayawada&lat=16.51667&lng=80.61667
4.https://atlantafencecompany.co/api/v1/growth/weather-promos?slug=nursery%2Fevergreen
5.https://atlantafencecompany.co/api/v1/growth/weather-telemetry?slug=nursery%2Fevergreen
make these 5 api's in single api to get single response and those are called once allowed location in mobile / web other wise don't called these api's and once location enabled call these api's
Subtasks
Related issues
Updated by Ajit A 3 days ago
- % Done changed from 0 to 100
Bug: Home page was executing unwanted coupon and popup API calls (/v1/nus-order/coupon/published and /v1/nus-shop/welcome-coupon) on every initial load. Fix: Removed <FirstOrderPromoDialog /> from
Dashboard.tsx
and suppressed <Promotion /> on the home page via !isHomePage in
AllRoutes.tsx
.
Bug: Home page fired multiple uncoordinated API requests (local-merch-context, weather-products, seasonal-products, weather-promos, and client telemetry) even before user granted location permission. Fix: Created a unified backend endpoint GET /api/v1/growth/home-merchandising in
growth.route.js
and
weatherProduct.controller.js
that resolves context, weather, seasonal products, and promo rules in parallel via Promise.allSettled while auto-recording impressions server-side. Implemented
useHomeMerchandising.ts
and
CustomerLocationContext.tsx
to strictly gate this call until user location is allowed (geolocation or manual).
Bug: Co-mounted desktop and mobile navigation headers triggered duplicate concurrent network requests to /v1/comm/notifications. Fix: Added module-level promise memoization (inFlightNotificationsPromise) and a 10-second memory cache (cachedNotificationNotes) to
OrderNotificationBell.tsx
, eliminating duplicate simultaneous requests and resetting cleanly upon note clearance