fix show in app
This commit is contained in:
@@ -262,9 +262,20 @@ class ProductController extends SuperController
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $id
|
||||
* @return \Illuminate\Http\JsonResponse
|
||||
* فعال/غیرفعال محصول — show باید با active همگام باشد (اپ کاربر از show استفاده میکند).
|
||||
*/
|
||||
public function active($id)
|
||||
{
|
||||
$product = Product::findOrFail($id);
|
||||
$active = !$product->active;
|
||||
$product->update([
|
||||
'active' => $active,
|
||||
'show' => $active,
|
||||
]);
|
||||
|
||||
return response()->json(true);
|
||||
}
|
||||
|
||||
public function hide($id)
|
||||
{
|
||||
$query = Product::findOrFail($id);
|
||||
|
||||
Reference in New Issue
Block a user