diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/FolderApiV2Controller.php | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/Controller/FolderApiV2Controller.php b/lib/Controller/FolderApiV2Controller.php index 4f98c0902..ecc775d3c 100644 --- a/lib/Controller/FolderApiV2Controller.php +++ b/lib/Controller/FolderApiV2Controller.php @@ -61,12 +61,7 @@ class FolderApiV2Controller extends ApiController } catch (ServiceValidationException $ex) { return $this->errorResponse($ex, Http::STATUS_BAD_REQUEST); } catch (ServiceConflictException $ex) { - $responseData = $this->serialize( - $this->folderService->findByName($this->getUserId(), $name) - ); - return $this->response([ - 'folder' => $responseData - ], Http::STATUS_CONFLICT); + return $this->errorResponse($ex, Http::STATUS_CONFLICT); } } @@ -86,15 +81,7 @@ class FolderApiV2Controller extends ApiController } catch (ServiceValidationException $ex) { return $this->errorResponse($ex, Http::STATUS_UNPROCESSABLE_ENTITY); } catch (ServiceConflictException $ex) { - $responseData = $this->serialize( - $this->folderService->findByName($this->getUserId(), $name) - ); - return $this->response( - [ - 'folder' => $responseData - ], - Http::STATUS_CONFLICT - ); + return $this->errorResponse($ex, Http::STATUS_CONFLICT); } catch (ServiceNotFoundException $ex) { return $this->errorResponse($ex, Http::STATUS_NOT_FOUND); } |