Skip to content

Commit

Permalink
Merge pull request #20 from udohjeremiah/dev
Browse files Browse the repository at this point in the history
Refactor code.
  • Loading branch information
udohjeremiah authored Apr 7, 2024
2 parents bd4fed4 + 001183a commit e4bbe5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"format": "prettier --check --ignore-path .gitignore .",
"format:fix": "prettier --write --ignore-path .gitignore .",
"prepare": "husky",
"postinstall": "prisma generate",
"generate": "dotenv -e .env.local pnpm dlx prisma generate",
"migrate": "dotenv -e .env.local pnpm dlx prisma migrate dev",
"studio": "dotenv -e .env.local pnpm dlx prisma studio"
"studio": "dotenv -e .env.local pnpm dlx prisma studio",
"postinstall": "prisma generate"
},
"dependencies": {
"@clerk/nextjs": "^4.29.11",
Expand Down
8 changes: 4 additions & 4 deletions src/app/api/webhook/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ export async function POST(request: Request) {
},
});

const productIds = order.OrderItem.map(
(orderItem) => orderItem.productId,
);

// Use this code if you want each product to be archived upon purchase.
// Otherwise, manually update products as archived in the admin panel.
/*
const productIds = order.OrderItem.map(
(orderItem) => orderItem.productId,
);
await prisma.product.updateMany({
where: { id: { in: [...productIds] } },
data: { isArchived: true },
Expand Down

0 comments on commit e4bbe5a

Please sign in to comment.