diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2020-04-06 17:59:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 17:59:58 +0200 |
commit | a0cb41c5098902c883a3dc95917fc074a64f42c3 (patch) | |
tree | 3c8ce4588df04c8de159d74d5ba756eff9993052 | |
parent | fbfeb200626cc1f985d3246be35a6b00a4ed89d5 (diff) | |
parent | a07872238b8fb743d7a8e09531d367454e8ebe3f (diff) | |
download | wallabag-a0cb41c5098902c883a3dc95917fc074a64f42c3.tar.gz wallabag-a0cb41c5098902c883a3dc95917fc074a64f42c3.tar.zst wallabag-a0cb41c5098902c883a3dc95917fc074a64f42c3.zip |
Merge pull request #4316 from wallabag/fix-remove-pictures-api
Fixed bug when we delete entry via API
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryRestController.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index c09fdaeb..5158171e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -239,12 +239,12 @@ class EntryRestController extends WallabagRestController | |||
239 | $results[$key]['url'] = $url; | 239 | $results[$key]['url'] = $url; |
240 | 240 | ||
241 | if (false !== $entry) { | 241 | if (false !== $entry) { |
242 | // entry deleted, dispatch event about it! | ||
243 | $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); | ||
244 | |||
242 | $em = $this->getDoctrine()->getManager(); | 245 | $em = $this->getDoctrine()->getManager(); |
243 | $em->remove($entry); | 246 | $em->remove($entry); |
244 | $em->flush(); | 247 | $em->flush(); |
245 | |||
246 | // entry deleted, dispatch event about it! | ||
247 | $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); | ||
248 | } | 248 | } |
249 | 249 | ||
250 | $results[$key]['entry'] = $entry instanceof Entry ? true : false; | 250 | $results[$key]['entry'] = $entry instanceof Entry ? true : false; |
@@ -610,13 +610,13 @@ class EntryRestController extends WallabagRestController | |||
610 | $response = $this->sendResponse($e); | 610 | $response = $this->sendResponse($e); |
611 | } | 611 | } |
612 | 612 | ||
613 | // entry deleted, dispatch event about it! | ||
614 | $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); | ||
615 | |||
613 | $em = $this->getDoctrine()->getManager(); | 616 | $em = $this->getDoctrine()->getManager(); |
614 | $em->remove($entry); | 617 | $em->remove($entry); |
615 | $em->flush(); | 618 | $em->flush(); |
616 | 619 | ||
617 | // entry deleted, dispatch event about it! | ||
618 | $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); | ||
619 | |||
620 | return $response; | 620 | return $response; |
621 | } | 621 | } |
622 | 622 | ||