From 326e4b467618d0b96d567ff227dd73ebe122d5f6 Mon Sep 17 00:00:00 2001 From: aniketceminds Date: Mon, 25 Nov 2024 15:36:00 +0530 Subject: [PATCH] fix: modified api of get orderHistory to get resuot in desc order --- apps/dragon-foods/pages/orderHistory.tsx | 2 +- apps/earth-support-initiative/pages/orderHistory.tsx | 2 +- apps/envirogrowth/pages/orderHistory.tsx | 2 +- apps/harmoni-aids/pages/orderHistory.tsx | 2 +- apps/sky-analytics/pages/orderHistory.tsx | 2 +- apps/state-forest-department/pages/orderHistory.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/dragon-foods/pages/orderHistory.tsx b/apps/dragon-foods/pages/orderHistory.tsx index bb8e4083..6480aeb7 100644 --- a/apps/dragon-foods/pages/orderHistory.tsx +++ b/apps/dragon-foods/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/earth-support-initiative/pages/orderHistory.tsx b/apps/earth-support-initiative/pages/orderHistory.tsx index faa65f1d..c36dcf36 100644 --- a/apps/earth-support-initiative/pages/orderHistory.tsx +++ b/apps/earth-support-initiative/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/envirogrowth/pages/orderHistory.tsx b/apps/envirogrowth/pages/orderHistory.tsx index faa65f1d..c36dcf36 100644 --- a/apps/envirogrowth/pages/orderHistory.tsx +++ b/apps/envirogrowth/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/harmoni-aids/pages/orderHistory.tsx b/apps/harmoni-aids/pages/orderHistory.tsx index faa65f1d..c36dcf36 100644 --- a/apps/harmoni-aids/pages/orderHistory.tsx +++ b/apps/harmoni-aids/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/sky-analytics/pages/orderHistory.tsx b/apps/sky-analytics/pages/orderHistory.tsx index faa65f1d..c36dcf36 100644 --- a/apps/sky-analytics/pages/orderHistory.tsx +++ b/apps/sky-analytics/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result) diff --git a/apps/state-forest-department/pages/orderHistory.tsx b/apps/state-forest-department/pages/orderHistory.tsx index faa65f1d..c36dcf36 100644 --- a/apps/state-forest-department/pages/orderHistory.tsx +++ b/apps/state-forest-department/pages/orderHistory.tsx @@ -32,7 +32,7 @@ const OrderHistory = () => { headers: myHeaders, redirect: 'follow' } - fetch(`${strapiUrl}/orders?filters[category]=${ORDER_CATEGORY_ID}`, requestOptions) + fetch(`${strapiUrl}/orders?filters[category][id][$eq]=${ORDER_CATEGORY_ID}&sort=updatedAt:desc`, requestOptions) .then(response => response.json()) .then(result => { console.log('resluttt', result)