mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
Add point-in-time normalization to stored object versions
Introduced a new normalizer for StoredObjectPointInTime and updated the StoredObjectVersionNormalizer to include point-in-time data when specified in the context. Added corresponding test cases to ensure the new normalization logic works correctly.
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Chill\DocStoreBundle\Controller;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Chill\DocStoreBundle\Security\Authorization\StoredObjectRoleEnum;
|
||||
use Chill\DocStoreBundle\Serializer\Normalizer\StoredObjectVersionNormalizer;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactoryInterface;
|
||||
use Chill\MainBundle\Serializer\Model\Collection;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
@@ -57,7 +58,11 @@ final readonly class StoredObjectVersionApiController
|
||||
$items = $storedObject->getVersions()->matching($criteria);
|
||||
|
||||
return new JsonResponse(
|
||||
$this->serializer->serialize(new Collection($items, $paginator), 'json', [AbstractNormalizer::GROUPS => ['read']]),
|
||||
$this->serializer->serialize(
|
||||
new Collection($items, $paginator),
|
||||
'json',
|
||||
[AbstractNormalizer::GROUPS => ['read', StoredObjectVersionNormalizer::WITH_POINT_IN_TIMES_CONTEXT]]
|
||||
),
|
||||
json: true
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user