@bindu-dashing/dam-solution-v2 5.8.73 → 5.8.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -244,26 +244,27 @@ function DriveContainer({ parentFolderId, setSelectedFile, setParentFolderId, pi
|
|
|
244
244
|
}, [brandId]);
|
|
245
245
|
// Fetch Shopify products when in shopify search mode
|
|
246
246
|
useEffect(() => {
|
|
247
|
-
console.log("Shopify search effect - shopifySearchMode:", shopifySearchMode, "
|
|
248
|
-
//
|
|
249
|
-
if (shopifySearchMode &&
|
|
247
|
+
console.log("Shopify search effect - shopifySearchMode:", shopifySearchMode, "folderSearch:", folderSearch);
|
|
248
|
+
// Using static token, so no need to check for coreApiToken
|
|
249
|
+
if (shopifySearchMode && folderSearch && folderSearch.length >= 2) {
|
|
250
250
|
fetchShopifyProducts(folderSearch);
|
|
251
251
|
}
|
|
252
252
|
else if (shopifySearchMode && (!folderSearch || folderSearch.length < 2)) {
|
|
253
253
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { shopifyProducts: [] })));
|
|
254
254
|
}
|
|
255
|
-
}, [shopifySearchMode,
|
|
255
|
+
}, [shopifySearchMode, folderSearch]);
|
|
256
256
|
const fetchShopifyProducts = (searchTerm) => __awaiter(this, void 0, void 0, function* () {
|
|
257
257
|
setState((prevState) => (Object.assign(Object.assign({}, prevState), { shopifyLoading: true })));
|
|
258
258
|
try {
|
|
259
|
-
//
|
|
259
|
+
// Hardcoded Shopify API URL and token for now
|
|
260
260
|
const shopifyApiBaseUrl = "https://staging-api.dashingone.com.au";
|
|
261
|
+
// Static token for Shopify API access - TODO: Replace with proper auth mechanism later
|
|
262
|
+
const shopifyStaticToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTAyOSwicGVybWlzc2lvbnMiOiJbe1wicmVzb3VyY2VfaWRcIjoyLFwiYWNjZXNzXCI6W1wicmVhZFwiXX0se1wicmVzb3VyY2VfaWRcIjoxLFwiYWNjZXNzXCI6W1wicmVhZFwiXX0se1wicmVzb3VyY2VfaWRcIjo1LFwiYWNjZXNzXCI6W1wiY3JlYXRlXCJdfSx7XCJyZXNvdXJjZV9pZFwiOjUsXCJhY2Nlc3NcIjpbXCJyZWFkXCJdfSx7XCJyZXNvdXJjZV9pZFwiOjUsXCJhY2Nlc3NcIjpbXCJ1cGRhdGVcIl19XSIsInRlYW1zIjoiWzE1OCwxNjUsMTA0XSIsInRlYW1JRCI6MTU4LCJicmFuZFRlYW1JRCI6MTA0LCJ0aGVtZUlEIjoxLCJlbWFpbCI6Im1haGVuZHJha29uZGFkYXN1QGdtYWlsLmNvbSIsImZpcnN0TmFtZSI6Ik1haGVuZHJhIiwibGFzdE5hbWUiOiJLb25kYWRhc3UiLCJpYXQiOjE3NjUyNjE1MzIsImV4cCI6MTc2NTMyMTUzMn0.1KcLUytTQQ2cqqOfNwuMt8vIdm1mJMv5mZZtCC9M1KA";
|
|
261
263
|
console.log("Shopify API Base URL:", shopifyApiBaseUrl);
|
|
262
|
-
console.log("Core API Token available:", !!coreApiToken);
|
|
263
264
|
const response = yield axios.get(`${shopifyApiBaseUrl}${FETCH_SHOPIFY_PRODUCTS_URL}`, {
|
|
264
265
|
params: { title: searchTerm },
|
|
265
266
|
headers: {
|
|
266
|
-
Authorization: `Bearer ${
|
|
267
|
+
Authorization: `Bearer ${shopifyStaticToken}`,
|
|
267
268
|
},
|
|
268
269
|
});
|
|
269
270
|
// Transform Shopify products to file entity format
|