diff options
Diffstat (limited to 'src/Wallabag/ApiBundle')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryRestController.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index acca219f..fc47c479 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -575,6 +575,9 @@ class EntryRestController extends WallabagRestController | |||
575 | $this->validateAuthentication(); | 575 | $this->validateAuthentication(); |
576 | $this->validateUserAccess($entry->getUser()->getId()); | 576 | $this->validateUserAccess($entry->getUser()->getId()); |
577 | 577 | ||
578 | // We copy $entry to keep id in returned object | ||
579 | $e = $entry; | ||
580 | |||
578 | $em = $this->getDoctrine()->getManager(); | 581 | $em = $this->getDoctrine()->getManager(); |
579 | $em->remove($entry); | 582 | $em->remove($entry); |
580 | $em->flush(); | 583 | $em->flush(); |
@@ -582,7 +585,7 @@ class EntryRestController extends WallabagRestController | |||
582 | // entry deleted, dispatch event about it! | 585 | // entry deleted, dispatch event about it! |
583 | $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); | 586 | $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); |
584 | 587 | ||
585 | return $this->sendResponse($entry); | 588 | return $this->sendResponse($e); |
586 | } | 589 | } |
587 | 590 | ||
588 | /** | 591 | /** |