mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
TopManga: fixes sfw
This commit is contained in:
parent
5f48cb39ff
commit
e5f24aefbd
@ -4,6 +4,8 @@ namespace App\Dto;
|
||||
|
||||
use App\Casts\EnumCast;
|
||||
use App\Contracts\DataRequest;
|
||||
use App\Dto\Concerns\HasSfwParameter;
|
||||
use App\Dto\Concerns\PreparesData;
|
||||
use App\Enums\MangaTypeEnum;
|
||||
use App\Enums\TopMangaFilterEnum;
|
||||
use App\Http\Resources\V4\MangaCollection;
|
||||
@ -17,6 +19,8 @@ use Spatie\LaravelData\Optional;
|
||||
*/
|
||||
final class QueryTopMangaItemsCommand extends QueryTopItemsCommand implements DataRequest
|
||||
{
|
||||
use PreparesData, HasSfwParameter;
|
||||
|
||||
#[WithCast(EnumCast::class, MangaTypeEnum::class), EnumValidation(MangaTypeEnum::class)]
|
||||
public MangaTypeEnum|Optional $type;
|
||||
|
||||
|
@ -20,13 +20,15 @@ final class DefaultMangaRepository extends DatabaseRepository implements MangaRe
|
||||
|
||||
public function getTopPublishingItems(): EloquentBuilder|ScoutBuilder
|
||||
{
|
||||
return $this->orderByRank()
|
||||
return $this
|
||||
->orderByRank()
|
||||
->where("publishing", true);
|
||||
}
|
||||
|
||||
public function getTopUpcomingItems(): EloquentBuilder|ScoutBuilder
|
||||
{
|
||||
return $this->orderByRank()
|
||||
return $this
|
||||
->orderByRank()
|
||||
->where("status", MangaStatusEnum::upcoming()->label);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user