fix(staff): preserve scanner history on deletion
This commit is contained in:
@@ -94,7 +94,12 @@ class StaffService
|
||||
|
||||
public function delete(Tenant $tenant, int $staffId): void
|
||||
{
|
||||
$this->find($tenant, $staffId)->delete();
|
||||
$staff = $this->find($tenant, $staffId);
|
||||
|
||||
DB::transaction(function () use ($staff): void {
|
||||
$staff->tokens()->delete();
|
||||
$staff->delete();
|
||||
});
|
||||
}
|
||||
|
||||
public function find(Tenant $tenant, int $staffId): User
|
||||
|
||||
Reference in New Issue
Block a user