Skip to content

Commit

Permalink
chores: update
Browse files Browse the repository at this point in the history
  • Loading branch information
kooya3 committed Aug 27, 2024
1 parent 2762c8c commit 21847d0
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 99 deletions.
17 changes: 16 additions & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
<!doctype html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/><link rel="icon" href="data:," data-placeholder-favicon/><script defer="defer" src="/admin/styles.31f3d4bf2bbeae911e3f.js"></script><script defer="defer" src="/admin/main.ff80d14ab25136140c84.js"></script><link href="/admin/styles.7094867468f7520dadc8.css" rel="stylesheet"></head><body><div id="app"></div><div id="portal"></div></body></html>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
<link rel="icon" href="data:," data-placeholder-favicon/>
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://trusted.cdn.com; style-src 'self' 'unsafe-inline' https://trusted.cdn.com; img-src 'self' data:; connect-src 'self' https://a6-e-shop.payloadcms.app;">
<script defer="defer" src="/admin/styles.31f3d4bf2bbeae911e3f.js"></script>
<script defer="defer" src="/admin/main.364d043c4cbca327e705.js"></script>
<link href="/admin/styles.7094867468f7520dadc8.css" rel="stylesheet">
</head>
<body>
<div id="app"></div>
<div id="portal"></div>
</body>
</html>
84 changes: 84 additions & 0 deletions build/main.364d043c4cbca327e705.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/app/(pages)/products/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Metadata } from 'next'
import { draftMode } from 'next/headers'
import { notFound } from 'next/navigation'

import { Product, Product as ProductType } from '../../../../payload/payload-types'
import type { Product, Product as ProductType } from '../../../../payload/payload-types'
import { fetchDoc } from '../../../_api/fetchDoc'
import { fetchDocs } from '../../../_api/fetchDocs'
import { Blocks } from '../../../_components/Blocks'
Expand Down Expand Up @@ -55,7 +55,7 @@ export default async function Product({ params: { slug } }) {
text: 'Related Products',
},
],
},
},
],
docs: relatedProducts,
},
Expand Down Expand Up @@ -88,4 +88,4 @@ export async function generateMetadata({ params: { slug } }): Promise<Metadata>
} catch (error) {}

return generateMeta({ doc: product })
}
}
90 changes: 0 additions & 90 deletions src/app/hook/createAccounts.ts

This file was deleted.

13 changes: 11 additions & 2 deletions src/payload/collections/Products/ui/ProductSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export const ProductSelect: React.FC<TextField> = props => {
value: string
}[]
>([])

const { value: stripeProductID } = useFormFields(([fields]) => fields[name])

const { value: stripeProductID, setValue: setStripeProductID } = useFormFields(([fields]) => fields[name])
const { value: bcProductID, setValue: setBcProductID } = useFormFields(([fields]) => fields['bcProductID'])

React.useEffect(() => {
const getStripeProducts = async () => {
Expand Down Expand Up @@ -114,6 +115,14 @@ export const ProductSelect: React.FC<TextField> = props => {
</div>
</div>
)}
<div>
<p style={{ marginBottom: '0' }}>bcProductID</p>
<input
type="text"
value={bcProductID}
onChange={e => setBcProductID(e.target.value)}
/>
</div>
</div>
)
}
2 changes: 1 addition & 1 deletion src/payload/fields/hero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const hero: Field = {
value: 'lowImpact',
},
{
label: 'Custom Hero',
label: 'Product Hero',
value: 'CustomHero',
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/payload/payload-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ export interface Product {
)[]
| null;
stripeProductID?: string | null;
// bcProductID?: string | null;
inventory?: number | null;
unitPrice?: number | null;
priceJSON?: string | null;
Expand Down Expand Up @@ -404,6 +403,7 @@ export interface Order {
id: string;
orderedBy?: (string | null) | User;
stripePaymentIntentID?: string | null;
bcProductID?: string | null;
total: number;
items?:
| {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit 21847d0

Please sign in to comment.