pint and some mod data changes

This commit is contained in:
IsWaffle 2024-09-11 14:15:13 -04:00
parent f443364721
commit f16b3fe497
5 changed files with 6 additions and 7 deletions

View File

@ -27,12 +27,13 @@ class Profile extends Component
$this->followers = $this->user->followers; $this->followers = $this->user->followers;
$this->following = $this->user->following; $this->following = $this->user->following;
$mods = $this->user->mods()->paginate(6); $mods = $this->user->mods()->withWhereHas('latestVersion')->paginate(6);
return view('livewire.user.profile', compact('mods')); return view('livewire.user.profile', compact('mods'));
} }
public function setSection(string $name) { public function setSection(string $name)
{
$this->section = $name; $this->section = $name;
} }

View File

@ -4,7 +4,6 @@ namespace App\Livewire;
use App\Models\User; use App\Models\User;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
use Livewire\Attributes\Reactive; use Livewire\Attributes\Reactive;
use Livewire\Component; use Livewire\Component;
@ -41,8 +40,7 @@ class UserStack extends Component
public function closeDialog() public function closeDialog()
{ {
if ($this->refreshNeeded) if ($this->refreshNeeded) {
{
$this->dispatch('refreshNeeded'); $this->dispatch('refreshNeeded');
} }

View File

@ -16,6 +16,7 @@ class UserFactory extends Factory
/** /**
* Define the user's default state. * Define the user's default state.
*
* @throws RandomException * @throws RandomException
*/ */
public function definition(): array public function definition(): array

View File

@ -113,7 +113,7 @@
</div> </div>
<div class="m-4 grid grid-cols-1 gap-6 lg:grid-cols-2"> <div class="m-4 grid grid-cols-1 gap-6 lg:grid-cols-2">
@foreach($mods as $mod) @foreach($mods as $mod)
<x-mod-card :mod="$mod"/> <x-mod-card :mod="$mod" versionScope="latestVersion" />
@endforeach @endforeach
</div> </div>
@break @break

View File

@ -31,7 +31,6 @@ test('confirm following a user cannot be done twice', function () {
$user1->follow($user2); $user1->follow($user2);
$user1->follow($user2); $user1->follow($user2);
$this->assertCount(1, $user1->following); $this->assertCount(1, $user1->following);
$this->assertCount(1, $user2->followers); $this->assertCount(1, $user2->followers);
}); });