Skip to content

Commit

Permalink
Merge branch 'develop' into feature/872-rrule-test
Browse files Browse the repository at this point in the history
  • Loading branch information
tuj authored Mar 19, 2024
2 parents 3d849dd + 586ef2d commit 103f838
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.

- [#194](https://github.com/os2display/display-api-service/pull/194)
Updated test run documentation and added test for `rrule` in playlist.
- Fixed issue with PlaylistSlide transaction.
- Fixed issues with feed following api platform upgrade.
- [#192](https://github.com/os2display/display-api-service/pull/192)
- Fix env value typo's
Expand Down
4 changes: 2 additions & 2 deletions src/Repository/PlaylistSlideRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public function getPlaylistsFromSlideId(Ulid $id): QueryBuilder

public function updatePlaylistSlideRelations(Ulid $playlistUlid, ArrayCollection $collection, Tenant $tenant): void
{
$this->entityManager->getConnection()->beginTransaction();

$playlistRepos = $this->entityManager->getRepository(Playlist::class);
$playlist = $playlistRepos->findOneBy(['id' => $playlistUlid, 'tenant' => $tenant]);

Expand All @@ -78,8 +80,6 @@ public function updatePlaylistSlideRelations(Ulid $playlistUlid, ArrayCollection

$slideRepos = $this->entityManager->getRepository(Slide::class);

$this->entityManager->getConnection()->beginTransaction();

try {
$entities = $this->findBy(['playlist' => $playlistUlid]);
$slideIdsToAdd = array_map(fn ($entry) => $entry->slide, $collection->toArray());
Expand Down
4 changes: 2 additions & 2 deletions tests/Api/PlaylistSlideTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public function testLinkSlideToPlaylist(): void
$iri = $this->findIriBy(Playlist::class, ['tenant' => $this->tenant]);
$playlistUlid = $this->iriHelperUtils->getUlidFromIRI($iri);

$iri = $this->findIriBy(Slide::class, ['tenant' => $this->tenant]);
$iri = $this->findIriBy(Slide::class, ['tenant' => $this->tenant, 'title' => 'slide_abc_2']);
$slideUlid1 = $this->iriHelperUtils->getUlidFromIRI($iri);
$iri = $this->findIriBy(Slide::class, ['tenant' => $this->tenant]);
$iri = $this->findIriBy(Slide::class, ['tenant' => $this->tenant, 'title' => 'slide_abc_3']);
$slideUlid2 = $this->iriHelperUtils->getUlidFromIRI($iri);

$client->request('PUT', '/v1/playlists/'.$playlistUlid.'/slides', [
Expand Down

0 comments on commit 103f838

Please sign in to comment.