Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Application\Shopify;
|
||||
@@ -33,21 +34,22 @@ final class ProductController
|
||||
try {
|
||||
$options = [
|
||||
'limit' => 50,
|
||||
'fields' => 'id,title,variants,images,status,published_at'
|
||||
'fields' => 'id,title,variants,images,status,published_at',
|
||||
];
|
||||
|
||||
$products = $this->client->getProducts($options);
|
||||
|
||||
return new JsonResult([
|
||||
'success' => true,
|
||||
'data' => $products
|
||||
'data' => $products,
|
||||
]);
|
||||
} catch (ApiException $e) {
|
||||
$result = new JsonResult([
|
||||
'success' => false,
|
||||
'error' => $e->getMessage()
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
$result->status = Status::from($e->getCode() ?: 500);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -63,14 +65,15 @@ final class ProductController
|
||||
|
||||
return new JsonResult([
|
||||
'success' => true,
|
||||
'data' => $product
|
||||
'data' => $product,
|
||||
]);
|
||||
} catch (ApiException $e) {
|
||||
$result = new JsonResult([
|
||||
'success' => false,
|
||||
'error' => $e->getMessage()
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
$result->status = Status::from($e->getCode() ?: 500);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -90,21 +93,23 @@ final class ProductController
|
||||
'tags' => $request->tags ?? '',
|
||||
'variants' => $request->variants ?? [],
|
||||
'options' => $request->options ?? [],
|
||||
'images' => $request->images ?? []
|
||||
'images' => $request->images ?? [],
|
||||
]);
|
||||
|
||||
$result = new JsonResult([
|
||||
'success' => true,
|
||||
'data' => $product
|
||||
'data' => $product,
|
||||
]);
|
||||
$result->status = Status::CREATED;
|
||||
|
||||
return $result;
|
||||
} catch (ApiException $e) {
|
||||
$result = new JsonResult([
|
||||
'success' => false,
|
||||
'error' => $e->getMessage()
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
$result->status = Status::from($e->getCode() ?: 500);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -119,27 +124,44 @@ final class ProductController
|
||||
$productData = [];
|
||||
|
||||
// Nur die Felder aktualisieren, die tatsächlich im Request enthalten sind
|
||||
if (isset($request->title)) $productData['title'] = $request->title;
|
||||
if (isset($request->description)) $productData['body_html'] = $request->description;
|
||||
if (isset($request->vendor)) $productData['vendor'] = $request->vendor;
|
||||
if (isset($request->productType)) $productData['product_type'] = $request->productType;
|
||||
if (isset($request->tags)) $productData['tags'] = $request->tags;
|
||||
if (isset($request->variants)) $productData['variants'] = $request->variants;
|
||||
if (isset($request->options)) $productData['options'] = $request->options;
|
||||
if (isset($request->images)) $productData['images'] = $request->images;
|
||||
if (isset($request->title)) {
|
||||
$productData['title'] = $request->title;
|
||||
}
|
||||
if (isset($request->description)) {
|
||||
$productData['body_html'] = $request->description;
|
||||
}
|
||||
if (isset($request->vendor)) {
|
||||
$productData['vendor'] = $request->vendor;
|
||||
}
|
||||
if (isset($request->productType)) {
|
||||
$productData['product_type'] = $request->productType;
|
||||
}
|
||||
if (isset($request->tags)) {
|
||||
$productData['tags'] = $request->tags;
|
||||
}
|
||||
if (isset($request->variants)) {
|
||||
$productData['variants'] = $request->variants;
|
||||
}
|
||||
if (isset($request->options)) {
|
||||
$productData['options'] = $request->options;
|
||||
}
|
||||
if (isset($request->images)) {
|
||||
$productData['images'] = $request->images;
|
||||
}
|
||||
|
||||
$product = $this->client->updateProduct($id, $productData);
|
||||
|
||||
return new JsonResult([
|
||||
'success' => true,
|
||||
'data' => $product
|
||||
'data' => $product,
|
||||
]);
|
||||
} catch (ApiException $e) {
|
||||
$result = new JsonResult([
|
||||
'success' => false,
|
||||
'error' => $e->getMessage()
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
$result->status = Status::from($e->getCode() ?: 500);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -155,14 +177,15 @@ final class ProductController
|
||||
|
||||
return new JsonResult([
|
||||
'success' => $success,
|
||||
'message' => $success ? 'Produkt erfolgreich gelöscht' : 'Produkt konnte nicht gelöscht werden'
|
||||
'message' => $success ? 'Produkt erfolgreich gelöscht' : 'Produkt konnte nicht gelöscht werden',
|
||||
]);
|
||||
} catch (ApiException $e) {
|
||||
$result = new JsonResult([
|
||||
'success' => false,
|
||||
'error' => $e->getMessage()
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
$result->status = Status::from($e->getCode() ?: 500);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -178,14 +201,15 @@ final class ProductController
|
||||
|
||||
return new JsonResult([
|
||||
'success' => true,
|
||||
'data' => $products
|
||||
'data' => $products,
|
||||
]);
|
||||
} catch (ApiException $e) {
|
||||
$result = new JsonResult([
|
||||
'success' => false,
|
||||
'error' => $e->getMessage()
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
$result->status = Status::from($e->getCode() ?: 500);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user