Update Stripe CLI command and key adjustments in line item components

The Stripe CLI command in the workflow file has been updated to use Docker. Additionally, the keys for line-item-details.tsx have been modified, changing item.id and tier.upTo to index to avoid potential key duplication issues within the same component.
This commit is contained in:
giancarlo
2024-04-15 16:31:22 +08:00
parent 2927d9980b
commit 002d252f36
2 changed files with 4 additions and 4 deletions

View File

@@ -105,7 +105,7 @@ jobs:
- name: Stripe CLI - name: Stripe CLI
run: | run: |
pnpm run stripe:listen & docker run --add-host=host.docker.internal:host-gateway --rm -it --name=stripe -d stripe/stripe-cli:latest listen --forward-to http://host.docker.internal:3000/api/billing/webhook --skip-verify --api-key "$STRIPE_SECRET_KEY" --log-level debug &
- name: Production Build (test env) - name: Production Build (test env)
run: pnpm --filter web build:test run: pnpm --filter web build:test

View File

@@ -18,13 +18,13 @@ export function LineItemDetails(
) { ) {
return ( return (
<div className={'flex flex-col space-y-1'}> <div className={'flex flex-col space-y-1'}>
{props.lineItems.map((item) => { {props.lineItems.map((item, index) => {
// If the item has a description, we render it as a simple text // If the item has a description, we render it as a simple text
// and pass the item as values to the translation so we can use // and pass the item as values to the translation so we can use
// the item properties in the translation. // the item properties in the translation.
if (item.description) { if (item.description) {
return ( return (
<div key={item.id} className={className}> <div key={index} className={className}>
<span className={'flex items-center space-x-1.5'}> <span className={'flex items-center space-x-1.5'}>
<PlusSquare className={'w-4'} /> <PlusSquare className={'w-4'} />
@@ -219,7 +219,7 @@ function Tiers({
return ( return (
<span <span
className={'text-secondary-foreground flex space-x-1 text-xs'} className={'text-secondary-foreground flex space-x-1 text-xs'}
key={tier.upTo} key={index}
> >
<span>-</span> <span>-</span>