Skip to content

Commit

Permalink
Refactor product query parameters to use StoreProductListParams and u…
Browse files Browse the repository at this point in the history
…pdate React dependencies
  • Loading branch information
anteprimorac committed Jan 8, 2025
1 parent 395459c commit b8ec3ec
Show file tree
Hide file tree
Showing 6 changed files with 670 additions and 2,493 deletions.
8 changes: 4 additions & 4 deletions storefront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"next": "^15.1.4",
"pg": "^8.13.1",
"qs": "^6.13.1",
"react": "rc",
"react": "^19.0.0",
"react-aria-components": "^1.5.0",
"react-country-flag": "^3.1.0",
"react-dom": "rc",
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.2",
"server-only": "^0.0.1",
"tailwind-merge": "^2.6.0",
Expand All @@ -59,8 +59,8 @@
"@types/lodash": "^4.17.14",
"@types/node": "^20.16.15",
"@types/pg": "^8.11.10",
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc",
"@types/react": "19.0.3",
"@types/react-dom": "^19.0.2",
"ansi-colors": "^4.1.3",
"autoprefixer": "^10.4.20",
"babel-loader": "^9.2.1",
Expand Down
4 changes: 2 additions & 2 deletions storefront/src/lib/data/products.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ export const getProductsList = cache(async function ({
countryCode,
}: {
pageParam?: number
queryParams?: HttpTypes.FindParams & HttpTypes.StoreProductParams
queryParams?: HttpTypes.FindParams & HttpTypes.StoreProductListParams
countryCode: string
}): Promise<{
response: { products: HttpTypes.StoreProduct[]; count: number }
nextPage: number | null
queryParams?: HttpTypes.FindParams & HttpTypes.StoreProductParams
queryParams?: HttpTypes.FindParams & HttpTypes.StoreProductListParams
}> {
const page = Math.max(1, pageParam || 1)
const limit = queryParams?.limit || 12
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react"
import * as React from "react"

import { isManual } from "@lib/constants"
import { UiRadio, UiRadioBox } from "@/components/ui/Radio"
Expand All @@ -7,7 +7,7 @@ import PaymentTest from "../payment-test"
type PaymentContainerProps = {
paymentProviderId: string
disabled?: boolean
paymentInfoMap: Record<string, { title: string; icon: JSX.Element }>
paymentInfoMap: Record<string, { title: string; icon: React.ReactNode }>
}

const PaymentContainer: React.FC<PaymentContainerProps> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default async function RelatedProducts({
}

// edit this function to define your related products logic
const queryParams: HttpTypes.StoreProductParams = {
const queryParams: HttpTypes.StoreProductListParams = {
limit: 3,
}
if (region?.id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function PaginatedProducts({
productsIds?: string[]
countryCode: string
}) {
const queryParams: HttpTypes.StoreProductParams = {
const queryParams: HttpTypes.StoreProductListParams = {
limit: PRODUCT_LIMIT,
}

Expand Down
Loading

0 comments on commit b8ec3ec

Please sign in to comment.