Skip to content

Commit 1d30404

Browse files
committed
feat: options on product page
1 parent 8bb6a23 commit 1d30404

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

src/app/api/products/[handle]/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export async function GET(
1919
"variants.options",
2020
"tags",
2121
"options",
22+
"options.values",
2223
"images",
2324
"description",
2425
"collection",

src/app/api/products/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export async function GET(request: NextRequest) {
1818
}
1919

2020
const [data, count] = await productService.listAndCount(filters, {
21-
relations: ["variants", "variants.options", "tags", "status"],
21+
relations: ["variants", "variants", "tags", "status"],
2222
take: parseInt(limit) || 100,
2323
skip: parseInt(offset) || 0,
2424
withDeleted: false,

src/modules/products/components/option-select/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ const OptionSelect: React.FC<OptionSelectProps> = ({
1616
updateOption,
1717
title,
1818
}) => {
19-
if (!option.values) return null
20-
2119
const filteredOptions = option.values.map((v) => v.value).filter(onlyUnique)
2220

2321
return (

0 commit comments

Comments
 (0)