Skip to content

Commit

Permalink
Merge pull request #27 from biigle/storage-quota-bug
Browse files Browse the repository at this point in the history
Fix storage quota validation error
  • Loading branch information
mzur authored Feb 15, 2024
2 parents b1d3b79 + 3d5455b commit 80f23dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Controllers/Api/StorageRequestUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class StorageRequestUserController extends Controller
public function store(Request $request, $id)
{
$request->validate([
'quota' => 'required|integer|min:0',
'quota' => 'required|numeric|min:0',
]);

$user = User::findOrFail($id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,13 @@ public function testStore()
->assertStatus(200);

$this->assertEquals(200, $user->fresh()->storage_quota_available);

$this
->postJson("/api/v1/users/{$user->id}/storage-request-quota", [
'quota' => "1E+11",
])
->assertStatus(200);

$this->assertEquals(1E+11, $user->fresh()->storage_quota_available);
}
}

0 comments on commit 80f23dd

Please sign in to comment.