mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
api: copy entry object before sending, to keep id
Workaround for https://github.com/wallabag/android-app/issues/646 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
This commit is contained in:
parent
d1f260e2d7
commit
f5ea67e4cf
3 changed files with 7 additions and 2 deletions
|
@ -575,6 +575,9 @@ class EntryRestController extends WallabagRestController
|
|||
$this->validateAuthentication();
|
||||
$this->validateUserAccess($entry->getUser()->getId());
|
||||
|
||||
// We copy $entry to keep id in returned object
|
||||
$e = $entry;
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->remove($entry);
|
||||
$em->flush();
|
||||
|
@ -582,7 +585,7 @@ class EntryRestController extends WallabagRestController
|
|||
// entry deleted, dispatch event about it!
|
||||
$this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
|
||||
|
||||
return $this->sendResponse($entry);
|
||||
return $this->sendResponse($e);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue