fix(product): 設定 is_active 欄位預設為 true 並更新現有資料為啟用
This commit is contained in:
@@ -196,10 +196,6 @@ class ProductController extends Controller
|
||||
$validated['code'] = $this->generateRandomCode();
|
||||
}
|
||||
|
||||
if (!isset($validated['is_active'])) {
|
||||
$validated['is_active'] = true;
|
||||
}
|
||||
|
||||
$product = Product::create($validated);
|
||||
|
||||
return redirect()->route('products.index')->with('success', '商品已建立');
|
||||
@@ -263,10 +259,6 @@ class ProductController extends Controller
|
||||
$validated['code'] = $this->generateRandomCode();
|
||||
}
|
||||
|
||||
if (!isset($validated['is_active'])) {
|
||||
$validated['is_active'] = true;
|
||||
}
|
||||
|
||||
$product->update($validated);
|
||||
|
||||
if ($request->input('from') === 'show') {
|
||||
|
||||
Reference in New Issue
Block a user