feat: ajout de la description et de la date d'ajout dans le endpoint MangaList
This commit is contained in:
parent
140cc14316
commit
7303d63198
@@ -3,6 +3,7 @@
|
||||
namespace App\Domain\Manga\Infrastructure\ApiPlatform\Dto;
|
||||
|
||||
use ApiPlatform\Metadata\ApiProperty;
|
||||
use DateTimeImmutable;
|
||||
|
||||
readonly class MangaListItem
|
||||
{
|
||||
@@ -10,12 +11,14 @@ readonly class MangaListItem
|
||||
#[ApiProperty(identifier: true)]
|
||||
public string $id,
|
||||
public string $title,
|
||||
public string $description,
|
||||
public string $slug,
|
||||
public ?string $imageUrl,
|
||||
public string $author,
|
||||
public int $publicationYear,
|
||||
public array $genres,
|
||||
public string $status,
|
||||
public ?float $rating
|
||||
public ?float $rating,
|
||||
public DateTimeImmutable $createdAt,
|
||||
) {}
|
||||
}
|
||||
@@ -45,12 +45,14 @@ readonly class GetMangaListStateProvider implements ProviderInterface
|
||||
id: $manga->getId()->getValue(),
|
||||
title: $manga->getTitle()->getValue(),
|
||||
slug: $manga->getSlug()->getValue(),
|
||||
description: $manga->getDescription(),
|
||||
imageUrl: $manga->getImageUrl(),
|
||||
author: $manga->getAuthor(),
|
||||
publicationYear: $manga->getPublicationYear(),
|
||||
genres: $manga->getGenres(),
|
||||
status: $manga->getStatus(),
|
||||
rating: $manga->getRating()
|
||||
rating: $manga->getRating(),
|
||||
createdAt: $manga->getCreatedAt()
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user