Skip to content

Commit

Permalink
fix(world): patch fix object duplication issue (#913)
Browse files Browse the repository at this point in the history
* fix(world): Items and traits duplication issue on encyclopedia

* fix(world): Actually the rest too
  • Loading branch information
SpeedyD authored Apr 18, 2024
1 parent d576e28 commit 8dc56e4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/Http/Controllers/WorldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getCurrencies(Request $request) {
}

return view('world.currencies', [
'currencies' => $query->orderBy('name')->paginate(20)->appends($request->query()),
'currencies' => $query->orderBy('name')->orderBy('id')->paginate(20)->appends($request->query()),
]);
}

Expand All @@ -67,7 +67,7 @@ public function getRarities(Request $request) {
}

return view('world.rarities', [
'rarities' => $query->orderBy('sort', 'DESC')->paginate(20)->appends($request->query()),
'rarities' => $query->orderBy('sort', 'DESC')->orderBy('id')->paginate(20)->appends($request->query()),
]);
}

Expand All @@ -86,7 +86,7 @@ public function getSpecieses(Request $request) {
return view('world.specieses', [
'specieses' => $query->with(['subtypes' => function ($query) {
$query->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC');
}])->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->paginate(20)->appends($request->query()),
}])->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->orderBy('id')->paginate(20)->appends($request->query()),
]);
}

Expand All @@ -103,7 +103,7 @@ public function getSubtypes(Request $request) {
}

return view('world.subtypes', [
'subtypes' => $query->with('species')->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->paginate(20)->appends($request->query()),
'subtypes' => $query->with('species')->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->orderBy('id')->paginate(20)->appends($request->query()),
]);
}

Expand All @@ -120,7 +120,7 @@ public function getItemCategories(Request $request) {
}

return view('world.item_categories', [
'categories' => $query->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->paginate(20)->appends($request->query()),
'categories' => $query->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->orderBy('id')->paginate(20)->appends($request->query()),
]);
}

Expand All @@ -137,7 +137,7 @@ public function getFeatureCategories(Request $request) {
}

return view('world.feature_categories', [
'categories' => $query->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->paginate(20)->appends($request->query()),
'categories' => $query->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->orderBy('id')->paginate(20)->appends($request->query()),
]);
}

Expand Down Expand Up @@ -212,7 +212,7 @@ public function getFeatures(Request $request) {
}

return view('world.features', [
'features' => $query->paginate(20)->appends($request->query()),
'features' => $query->orderBy('id')->paginate(20)->appends($request->query()),
'rarities' => ['none' => 'Any Rarity'] + Rarity::orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'specieses' => ['none' => 'Any Species'] + ['withoutOption' => 'Without Species'] + Species::visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'subtypes' => ['none' => 'Any Subtype'] + ['withoutOption' => 'Without Subtype'] + Subtype::visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
Expand Down Expand Up @@ -355,7 +355,7 @@ public function getItems(Request $request) {
}

return view('world.items', [
'items' => $query->paginate(20)->appends($request->query()),
'items' => $query->orderBy('id')->paginate(20)->appends($request->query()),
'categories' => ['none' => 'Any Category'] + ['withoutOption' => 'Without Category'] + ItemCategory::visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->pluck('name', 'id')->toArray(),
'shops' => Shop::orderBy('sort', 'DESC')->get(),
'artists' => ['none' => 'Any Artist'] + User::whereIn('id', Item::whereNotNull('artist_id')->pluck('artist_id')->toArray())->pluck('name', 'id')->toArray(),
Expand Down Expand Up @@ -409,7 +409,7 @@ public function getCharacterCategories(Request $request) {
}

return view('world.character_categories', [
'categories' => $query->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->paginate(20)->appends($request->query()),
'categories' => $query->visible(Auth::check() ? Auth::user() : null)->orderBy('sort', 'DESC')->orderBy('id')->paginate(20)->appends($request->query()),
]);
}
}

0 comments on commit 8dc56e4

Please sign in to comment.