Skip to content

Commit

Permalink
Fix: Did an oopsie :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timtendo12 committed Feb 1, 2024
1 parent f39f1f9 commit 55cac53
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/app/Http/Controllers/GrantController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,11 @@ public function GrantItem(GrantItemRequest $request) {
$grant = Grant::where('user_id', $user->id)
->where('item_id', $item->id)
->where('modified_kind', '!=', ModifiedEnum::deleted)
->where('return_date', null)
->first();

if (isset($grant)) {

if ($grant->return_date != null) {
return $this->CommonResponse(
ResponseStatus::forbidden, 'Item already returned', null
);
}

$grant->return_date = now();
$grant->modified_kind = ModifiedEnum::modified;
$grant->modified_user = $user->id;
Expand Down

0 comments on commit 55cac53

Please sign in to comment.