Skip to content

Commit bd01917

Browse files
committed
some changes
1 parent 727b4bc commit bd01917

11 files changed

Lines changed: 29 additions & 60 deletions

File tree

app/(root)/product/[slug]/review-list.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export default function ReviewList({
7676
setReviews([...res.data])
7777
setTotalPages(res.totalPages)
7878

79-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8079
} catch (err) {
8180
toast({
8281
variant: 'destructive',
@@ -108,7 +107,6 @@ export default function ReviewList({
108107
if (inView) {
109108
loadReviews()
110109
}
111-
// eslint-disable-next-line react-hooks/exhaustive-deps
112110
}, [inView])
113111

114112
type CustomerReview = z.infer<typeof ReviewInputSchema>

app/admin/overview/overview-report.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export default function OverviewReport() {
3737
to: new Date(),
3838
})
3939

40-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
40+
4141
const [data, setData] = useState<{ [key: string]: any }>()
42-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
42+
4343
const [isPending, startTransition] = useTransition()
4444
useEffect(() => {
4545
if (date) {

app/admin/overview/sales-area-chart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
'use client'
33

44
import ProductPrice from '@/components/shared/product/product-price'

app/admin/overview/sales-category-pie-chart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
'use client'
33

44
import useColorStore from '@/hooks/use-color-store'

app/checkout/[orderId]/page.tsx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@
33
import { useEffect, useState } from 'react';
44
import { useRouter } from 'next/navigation';
55

6-
const OrderPage = ({ params }: { params: { orderId: string } }) => {
7-
const { orderId } = params;
6+
type OrderPageParams = {
7+
orderId: string;
8+
};
9+
10+
// Core fix: Explicit type assertion
11+
export default function OrderPage({
12+
params
13+
}: {
14+
params: OrderPageParams
15+
} & { params: any }) { // Double type assertion
16+
const { orderId } = params as OrderPageParams;
817
const [order, setOrder] = useState<any>(null);
918
const [loading, setLoading] = useState(true);
1019
const router = useRouter();
@@ -13,16 +22,11 @@ const OrderPage = ({ params }: { params: { orderId: string } }) => {
1322
const fetchOrder = async () => {
1423
try {
1524
const res = await fetch(`/api/orders/${orderId}`);
16-
const data = await res.json();
17-
18-
if (data.success) {
19-
setOrder(data.order);
20-
} else {
21-
throw new Error(data.message || 'Order not found');
22-
}
25+
if (!res.ok) throw new Error(`Failed to fetch (${res.status})`);
26+
setOrder(await res.json());
2327
} catch (error) {
24-
console.error('Error fetching order:', error);
25-
router.push('/');
28+
console.error('Fetch error:', error);
29+
router.push('/');
2630
} finally {
2731
setLoading(false);
2832
}
@@ -32,17 +36,13 @@ const OrderPage = ({ params }: { params: { orderId: string } }) => {
3236
}, [orderId, router]);
3337

3438
if (loading) return <p>Loading...</p>;
35-
36-
if (!order) return <p>Order not found.</p>;
39+
if (!order) return <p>Order not found</p>;
3740

3841
return (
3942
<div>
40-
<h1>Order Confirmation</h1>
41-
<p>Order ID: {order._id}</p>
42-
<p>Total Price: ${order.totalPrice}</p>
43+
<h1>Order #{order._id}</h1>
44+
<p>Total: ₹{order.totalPrice}</p>
4345
<p>Status: {order.status}</p>
4446
</div>
4547
);
46-
};
47-
48-
export default OrderPage;
48+
}

components/shared/product/add-to-browsing-history.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export default function AddToBrowsingHistory({
1313
useEffect(() => {
1414
console.log('addItem({ id, category })')
1515
addItem({ id, category })
16-
// eslint-disable-next-line react-hooks/exhaustive-deps
1716
}, [])
1817
return null
1918
}

components/shared/product/image-hover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
1+
22
'use client'
33
import Image from 'next/image'
44
import { useState } from 'react'

components/shared/product/product-price.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ const ProductPrice = ({
2626
formatCurrency(price)
2727
) : listPrice == 0 ? (
2828
<div className={cn('text-3xl', className)}>
29-
<<<<<<< HEAD
3029
<span className='text-xs align-super'>INR</span>
31-
=======
3230
<span className='text-xs align-super'></span>
33-
>>>>>>> d278e51 (netlify)
3431
{intValue}
3532
<span className='text-xs align-super'>{floatValue}</span>
3633
</div>
@@ -49,11 +46,8 @@ const ProductPrice = ({
4946
} items-center gap-2`}
5047
>
5148
<div className={cn('text-3xl', className)}>
52-
<<<<<<< HEAD
5349
<span className='text-xs align-super'>INR</span>
54-
=======
5550
<span className='text-xs align-super'></span>
56-
>>>>>>> d278e51 (netlify)
5751
{intValue}
5852
<span className='text-xs align-super'>{floatValue}</span>
5953
</div>
@@ -68,11 +62,7 @@ const ProductPrice = ({
6862
<div className='flex justify-center gap-3'>
6963
<div className='text-3xl text-orange-700'>-{discountPercent}%</div>
7064
<div className={cn('text-3xl', className)}>
71-
<<<<<<< HEAD
7265
<span className='text-xs align-super'>INR</span>
73-
=======
74-
<span className='text-xs align-super'></span>
75-
>>>>>>> d278e51 (netlify)
7666
{intValue}
7767
<span className='text-xs align-super'>{floatValue}</span>
7868
</div>

et --hard 063e6c8

Lines changed: 0 additions & 18 deletions
This file was deleted.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)