From 39aa8530424310663c888f9e02224158961532e3 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 30 Oct 2018 18:41:29 +0100 Subject: PHP is crap --- api/Posts/Controllers/PostController.php | 57 -------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 api/Posts/Controllers/PostController.php (limited to 'api/Posts/Controllers/PostController.php') diff --git a/api/Posts/Controllers/PostController.php b/api/Posts/Controllers/PostController.php deleted file mode 100644 index 105c7c2..0000000 --- a/api/Posts/Controllers/PostController.php +++ /dev/null @@ -1,57 +0,0 @@ -postService = $postService; - } - - public function getAll() - { - $resourceOptions = $this->parseResourceOptions(); - - $data = $this->postService->getAll($resourceOptions); - $parsedData = $this->parseData($data, $resourceOptions, 'posts'); - - return $this->response($parsedData); - } - - public function getById($postId) - { - $resourceOptions = $this->parseResourceOptions(); - - $data = $this->postService->getById($postId, $resourceOptions); - $parsedData = $this->parseData($data, $resourceOptions, 'post'); - - return $this->response($parsedData); - } - - public function create(CreatePostRequest $request) - { - $data = $request->get('post', []); - - return $this->response($this->postService->create($data), 201); - } - - public function update($postId, Request $request) - { - $data = $request->get('post', []); - - return $this->response($this->postService->update($postId, $data)); - } - - public function delete($postId) - { - return $this->response($this->postService->delete($postId)); - } -} -- cgit v1.2.3