Skip to content

Commit

Permalink
delete validation
Browse files Browse the repository at this point in the history
  • Loading branch information
arfenis committed Aug 2, 2024
1 parent 2c19eb0 commit 905fdfc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/GraphQL/Inventory/Mutations/Warehouses/Warehouse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace App\GraphQL\Inventory\Mutations\Warehouses;

use Kanvas\Companies\Repositories\CompaniesRepository;
use Kanvas\Inventory\Regions\Repositories\RegionRepository;
use Kanvas\Inventory\Variants\Actions\DeleteWarehouseAction;
use Kanvas\Inventory\Warehouses\Actions\CreateWarehouseAction;
use Kanvas\Inventory\Warehouses\DataTransferObject\Warehouses as WarehousesDto;
use Kanvas\Inventory\Warehouses\Models\Warehouses;
Expand Down Expand Up @@ -56,6 +58,11 @@ public function delete(mixed $root, array $request): bool
{
$warehouse = WarehouseRepository::getById((int) $request['id'], auth()->user()->getCurrentCompany());

CompaniesRepository::userAssociatedToCompany(
$warehouse->company,
auth()->user()
);

return $warehouse->delete();
}
}

0 comments on commit 905fdfc

Please sign in to comment.