Add ability to remove feeds
This commit is contained in:
1 parent
5c8892e12f
commit
cee4f9944e
6 files changed
+26
-7
No files matched your search
@@ -54,4 +54,16 @@ class FeedController
|
||||
|
||||
return $this->view->render($response, 'create.twig.html');
|
||||
}
|
||||
|
||||
public function delete(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
|
||||
{
|
||||
$this->logger->info("FeedController::delete() called");
|
||||
$feed = $this->feedRepository->find($request->getAttribute('id'));
|
||||
if (empty($feed)) {
|
||||
return $response->withStatus(404);
|
||||
}
|
||||
|
||||
$this->feedRepository->delete($feed);
|
||||
return $response->withStatus(201)->withHeader('Location', '/feed');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user