Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ts errors #377

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
"dependencies": {
"@headlessui/react": "^1.6.1",
"@hookform/error-message": "^2.0.0",
"@medusajs/js-sdk": "preview",
"@medusajs/types": "preview",
"@medusajs/ui": "preview",
"@medusajs/js-sdk": "rc",
"@medusajs/ui": "rc",
"@meilisearch/instant-meilisearch": "^0.7.1",
"@paypal/paypal-js": "^5.0.6",
"@paypal/react-paypal-js": "^7.8.1",
Expand All @@ -47,8 +46,8 @@
},
"devDependencies": {
"@babel/core": "^7.17.5",
"@medusajs/client-types": "preview",
"@medusajs/ui-preset": "preview",
"@medusajs/types": "rc",
"@medusajs/ui-preset": "rc",
"@playwright/test": "^1.41.1",
"@types/lodash": "^4.14.195",
"@types/node": "17.0.21",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/data/customer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function signup(_currentState: unknown, formData: FormData) {
})

const customHeaders = { authorization: `Bearer ${token}` }

const { customer: createdCustomer } = await sdk.store.customer.create(
customerForm,
{},
Expand All @@ -55,7 +55,7 @@ export async function signup(_currentState: unknown, formData: FormData) {
password,
})

setAuthToken(loginToken)
setAuthToken(loginToken as string)

revalidateTag("customer")
return createdCustomer
Expand All @@ -72,7 +72,7 @@ export async function login(_currentState: unknown, formData: FormData) {
await sdk.auth
.login("customer", "emailpass", { email, password })
.then((token) => {
setAuthToken(token)
setAuthToken(token as string)
revalidateTag("customer")
})
} catch (error: any) {
Expand Down
8 changes: 4 additions & 4 deletions src/modules/products/components/related-products/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Product from "../product-preview"
import { getRegion } from "@lib/data/regions"
import { getProductsList } from "@lib/data/products"
import { getRegion } from "@lib/data/regions"
import { HttpTypes } from "@medusajs/types"
import Product from "../product-preview"

type RelatedProductsProps = {
product: HttpTypes.StoreProduct
Expand All @@ -27,8 +27,8 @@ export default async function RelatedProducts({
queryParams.collection_id = [product.collection_id]
}
if (product.tags) {
queryParams.tags = product.tags
.map((t) => t.value)
queryParams.tag_id = product.tags
.map((t) => t.id)
.filter(Boolean) as string[]
}
queryParams.is_giftcard = false
Expand Down
Loading
Loading