diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-05-31 21:39:53 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-05-31 21:39:53 +0700 |
| commit | 77f976d3bd09d9e00d4d55bbd40579b439405d96 (patch) | |
| tree | a8959bba3d8a51570c439789f92653409a0065ae /src/api | |
| parent | ca05a70e98e9066882de6394ffbd89db7af2cb9d (diff) | |
| parent | 2a1dea70b8f0062fe8eebeb7139a7b77a24e220b (diff) | |
Merge branch 'new-release' of https://bitbucket.org/altafixco/next-indoteknik into biteship-merge
# Conflicts:
# src/lib/checkout/components/Checkout.jsx
# src/lib/transaction/components/Transaction.jsx
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/productApi.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/api/productApi.js b/src/api/productApi.js index 4a29b59d..dc96a77e 100644 --- a/src/api/productApi.js +++ b/src/api/productApi.js @@ -1,13 +1,15 @@ -import axios from 'axios' +import axios from 'axios'; export const popularProductApi = () => { return async () => { const today = new Date(); - const dayOfYear = Math.floor((today - new Date(today.getFullYear(), 0, 0)) / 86400000); + const dayOfYear = Math.floor( + (today - new Date(today.getFullYear(), 0, 0)) / 86400000 + ); const page = (dayOfYear % 24) + 1; const dataPopularProducts = await axios( `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/search?q=*&page=${page}&orderBy=stock&priceFrom=1` - ) - return dataPopularProducts.data.response - } -} + ); + return dataPopularProducts.data.response; + }; +}; |
