Skip to content

Commit

Permalink
fix: disallow transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
ScuffedNewt committed Sep 3, 2024
1 parent 21de0fc commit 51bb5d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Admin/Data/ShopController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions app/Services/ShopService.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ public function updateShop($shop, $data, $user) {
}

/**
* Updates shop stock.
* Creates shop stock.
*
* @param Shop $shop
* @param array $data
* @param \App\Models\User\User $user
*
* @return bool|Shop
*/
public function updateShopStock($shop, $data, $user) {
public function createShopStock($shop, $data, $user) {
DB::beginTransaction();

try {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/admin/shops/create_edit_shop.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<div class="row col-12">
@foreach ($shop->stock as $stock)
<div class="col-md-4">
<div class="card p-3 my-1">
<div class="card h-100 p-3 my-1">
<div class="row">
@if ($stock->item->has_image)
<div class="col-2">
Expand Down

0 comments on commit 51bb5d6

Please sign in to comment.