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