diff --git a/app/api/cart/route.ts b/app/api/cart/route.ts index 15f5fb09f..c20bac3f8 100644 --- a/app/api/cart/route.ts +++ b/app/api/cart/route.ts @@ -55,7 +55,7 @@ export async function PUT(req: NextRequest): Promise { } } -export async function DELETE(req: NextRequest): Promise { +export async function PATCH(req: NextRequest): Promise { const cartId = cookies().get('cartId')?.value; const { lineId } = await req.json(); diff --git a/components/cart/delete-item-button.tsx b/components/cart/delete-item-button.tsx index 789a87754..973388267 100644 --- a/components/cart/delete-item-button.tsx +++ b/components/cart/delete-item-button.tsx @@ -14,7 +14,7 @@ export default function DeleteItemButton({ item }: { item: CartItem }) { setRemoving(true); const response = await fetch(`/api/cart`, { - method: 'DELETE', + method: 'PATCH', body: JSON.stringify({ lineId: item.id }) diff --git a/components/cart/edit-item-quantity-button.tsx b/components/cart/edit-item-quantity-button.tsx index 2249bd1aa..5986234b4 100644 --- a/components/cart/edit-item-quantity-button.tsx +++ b/components/cart/edit-item-quantity-button.tsx @@ -21,7 +21,7 @@ export default function EditItemQuantityButton({ setEditing(true); const response = await fetch(`/api/cart`, { - method: type === 'minus' && item.quantity - 1 === 0 ? 'DELETE' : 'PUT', + method: type === 'minus' && item.quantity - 1 === 0 ? 'PATCH' : 'PUT', body: JSON.stringify({ lineId: item.id, variantId: item.merchandise.id, @@ -58,9 +58,9 @@ export default function EditItemQuantityButton({ {editing ? ( ) : type === 'plus' ? ( - + ) : ( - + )} );