File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,23 +63,12 @@ public function createPost(User $user, array $data): array
6363 // Attach genres
6464 $ this ->postRepository ->attachGenres ($ post , $ data ['genre_ids ' ]);
6565
66- // Create pool entry
67- $ poolEntry = $ this ->poolEntryRepository ->create ([
66+ // Create pool entry
67+ $ this ->poolEntryRepository ->create ([
6868 'post_id ' => $ post ->id ,
6969 'is_consumed ' => false ,
7070 ]);
7171
72- // 1. Find waiting users and assign them the new post
73- $ waitingExchange = $ this ->exchangeRepository ->findWaitingExchange ($ user , $ track );
74-
75- if ($ waitingExchange ) {
76- $ this ->poolEntryRepository ->markAsConsumed ($ poolEntry );
77- $ this ->exchangeRepository ->update ($ waitingExchange , [
78- 'received_post_id ' => $ post ->id ,
79- ]);
80- }
81-
82- // 2. Find a song for current user
8372 $ receivedTrackIds = $ this ->exchangeRepository ->getReceivedTrackIds ($ user );
8473 $ availablePoolEntry = $ this ->poolEntryRepository ->findAvailableEntry ($ user , $ receivedTrackIds );
8574
You can’t perform that action at this time.
0 commit comments