From 51bb5d6a4f7c457e635e323ef599da1e94587997 Mon Sep 17 00:00:00 2001 From: ScuffedNewt Date: Tue, 3 Sep 2024 19:18:49 +0100 Subject: [PATCH] fix: disallow transfers --- app/Http/Controllers/Admin/Data/ShopController.php | 4 ++-- app/Services/ShopService.php | 4 ++-- resources/views/admin/shops/create_edit_shop.blade.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Admin/Data/ShopController.php b/app/Http/Controllers/Admin/Data/ShopController.php index d45446926..19364e586 100644 --- a/app/Http/Controllers/Admin/Data/ShopController.php +++ b/app/Http/Controllers/Admin/Data/ShopController.php @@ -196,9 +196,9 @@ public function postEditShopStock(Request $request, ShopService $service, $id) { public function postCreateShopStock(Request $request, ShopService $service, $id) { $data = $request->only([ 'shop_id', 'item_id', 'currency_id', 'cost', 'use_user_bank', 'use_character_bank', 'is_limited_stock', 'quantity', 'purchase_limit', 'purchase_limit_timeframe', 'is_fto', 'stock_type', 'is_visible', - 'restock', 'restock_quantity', 'restock_interval', 'range', 'is_timed_stock', 'start_at', 'end_at', + 'restock', 'restock_quantity', 'restock_interval', 'range', 'disallow_transfer', 'is_timed_stock', 'start_at', 'end_at', ]); - if ($service->updateShopStock(Shop::find($id), $data, Auth::user())) { + if ($service->createShopStock(Shop::find($id), $data, Auth::user())) { flash('Shop stock updated successfully.')->success(); return redirect()->back(); diff --git a/app/Services/ShopService.php b/app/Services/ShopService.php index f541dbe07..3e19621ac 100644 --- a/app/Services/ShopService.php +++ b/app/Services/ShopService.php @@ -106,7 +106,7 @@ public function updateShop($shop, $data, $user) { } /** - * Updates shop stock. + * Creates shop stock. * * @param Shop $shop * @param array $data @@ -114,7 +114,7 @@ public function updateShop($shop, $data, $user) { * * @return bool|Shop */ - public function updateShopStock($shop, $data, $user) { + public function createShopStock($shop, $data, $user) { DB::beginTransaction(); try { diff --git a/resources/views/admin/shops/create_edit_shop.blade.php b/resources/views/admin/shops/create_edit_shop.blade.php index 16683e3a1..4aa9defe2 100644 --- a/resources/views/admin/shops/create_edit_shop.blade.php +++ b/resources/views/admin/shops/create_edit_shop.blade.php @@ -112,7 +112,7 @@
@foreach ($shop->stock as $stock)
-
+
@if ($stock->item->has_image)