summaryrefslogtreecommitdiff
path: root/src/pages/google_merchant
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-25 14:07:26 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-25 14:07:26 +0700
commite7313b4d7006bed37a408d26f15028892839b73a (patch)
treed0d6c9455ca6aac305efc094639dd6886b34fb14 /src/pages/google_merchant
parentd1c0e083ac8f64dfaa8505fc11e30728dbd5a58d (diff)
parente8f640d3fd4984fe5854c2faf7ead9b3b5aebbf2 (diff)
Merge branch 'new-release' into bug-product
Diffstat (limited to 'src/pages/google_merchant')
-rw-r--r--src/pages/google_merchant/products/[page].js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pages/google_merchant/products/[page].js b/src/pages/google_merchant/products/[page].js
index 6e0eb703..0c2cf3c5 100644
--- a/src/pages/google_merchant/products/[page].js
+++ b/src/pages/google_merchant/products/[page].js
@@ -50,7 +50,7 @@ export async function getServerSideProps({ res, query }) {
let categoryId = null;
if (brandId && brandId in brandsData) {
- categoryId = brandsData[brandId].category_ids?.[0] ?? null;
+ categoryId = brandsData[brandId]?.category_ids?.[0] ?? null;
} else {
const solrBrand = await getBrandById(brandId);
brandsData[brandId] = solrBrand;
@@ -58,7 +58,7 @@ export async function getServerSideProps({ res, query }) {
}
if (categoryId && categoryId in categoriesData) {
- categoryName = categoriesData[categoryId].name_s ?? null;
+ categoryName = categoriesData[categoryId]?.name_s ?? null;
} else {
const solrCategory = await getCategoryById(categoryId);
categoriesData[categoryId] = solrCategory;