category qosishsh to'g'irlandi
This commit is contained in:
@@ -24,11 +24,12 @@ use App\Jobs\Dashboard\Product\Child as ChildJob;
|
|||||||
use App\Jobs\Dashboard\Product\ChildUpdate as ChildUpdateJob;
|
use App\Jobs\Dashboard\Product\ChildUpdate as ChildUpdateJob;
|
||||||
use App\Jobs\Dashboard\Product\Update as UpdateJob;
|
use App\Jobs\Dashboard\Product\Update as UpdateJob;
|
||||||
use App\Jobs\Dashboard\Product\Deletes as DeletesJob;
|
use App\Jobs\Dashboard\Product\Deletes as DeletesJob;
|
||||||
use Exception;
|
|
||||||
use Illuminate\Support\Facades\Date;
|
use Illuminate\Support\Facades\Date;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Support\Facades\Response;
|
use Illuminate\Support\Facades\Response;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
class Controller extends ExController
|
class Controller extends ExController
|
||||||
{
|
{
|
||||||
@@ -97,10 +98,17 @@ class Controller extends ExController
|
|||||||
|
|
||||||
$this->charSync($product, $request->characteristics);
|
$this->charSync($product, $request->characteristics);
|
||||||
$this->dispatchSync(new ChildJob($request, $product));
|
$this->dispatchSync(new ChildJob($request, $product));
|
||||||
} catch (Exception $e) {
|
} catch (Throwable $e) {
|
||||||
|
Log::error('Product store failed', [
|
||||||
|
'message' => $e->getMessage(),
|
||||||
|
'category_id' => $request->get('category_id'),
|
||||||
|
'trace' => $e->getTraceAsString(),
|
||||||
|
]);
|
||||||
|
|
||||||
return Response::json([
|
return Response::json([
|
||||||
'status' => false,
|
'status' => false,
|
||||||
'messages' => $e->getMessage()
|
'messages' => 'Product could not be saved.',
|
||||||
|
'error' => config('app.debug') ? $e->getMessage() : null,
|
||||||
], 500);
|
], 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,10 +349,18 @@ class Controller extends ExController
|
|||||||
$this->dispatchSync(new ChildUpdateJob($request, $product));
|
$this->dispatchSync(new ChildUpdateJob($request, $product));
|
||||||
$this->charSync($product, $request->characteristics);
|
$this->charSync($product, $request->characteristics);
|
||||||
$this->dispatchSync(new DeletesJob($request));
|
$this->dispatchSync(new DeletesJob($request));
|
||||||
} catch (Exception $e) {
|
} catch (Throwable $e) {
|
||||||
|
Log::error('Product update failed', [
|
||||||
|
'product_id' => $product->id,
|
||||||
|
'message' => $e->getMessage(),
|
||||||
|
'category_id' => $request->get('category_id'),
|
||||||
|
'trace' => $e->getTraceAsString(),
|
||||||
|
]);
|
||||||
|
|
||||||
return Response::json([
|
return Response::json([
|
||||||
'status' => false,
|
'status' => false,
|
||||||
'messages' => $e->getMessage()
|
'messages' => 'Product could not be saved.',
|
||||||
|
'error' => config('app.debug') ? $e->getMessage() : null,
|
||||||
], 500);
|
], 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1451,6 +1451,7 @@ export default {
|
|||||||
this.error = true;
|
this.error = true;
|
||||||
this.errors = error.response.data.errors || {
|
this.errors = error.response.data.errors || {
|
||||||
product: [
|
product: [
|
||||||
|
error.response.data.error ||
|
||||||
error.response.data.messages ||
|
error.response.data.messages ||
|
||||||
"Ошибка при сохранении",
|
"Ошибка при сохранении",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1322,6 +1322,7 @@ export default {
|
|||||||
this.error = true;
|
this.error = true;
|
||||||
this.errors = error.response.data.errors || {
|
this.errors = error.response.data.errors || {
|
||||||
product: [
|
product: [
|
||||||
|
error.response.data.error ||
|
||||||
error.response.data.messages ||
|
error.response.data.messages ||
|
||||||
error.response.data.message ||
|
error.response.data.message ||
|
||||||
"Ошибка при сохранении",
|
"Ошибка при сохранении",
|
||||||
|
|||||||
Reference in New Issue
Block a user