diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-11-28 11:18:47 +0300 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-12-02 14:28:31 +0300 |
commit | c1e009c77b87e0d4caaf1628e5e7a12b99cacde9 (patch) | |
tree | 68c2d554c0382e9967a046c955d433e58f977d6e | |
parent | 9d645c80108a79d15dd3ef276b9e0d9f154f00fd (diff) |
Move to POST
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r-- | appinfo/routes.php | 2 | ||||
-rw-r--r-- | lib/Controller/WorkspaceController.php | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/appinfo/routes.php b/appinfo/routes.php index b1362dc39..4951d865b 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -43,7 +43,7 @@ return [ 'ocs' => [ ['name' => 'Workspace#folder', 'url' => '/workspace', 'verb' => 'GET'], ['name' => 'Workspace#publicFolder', 'url' => '/public/workspace', 'verb' => 'GET'], - ['name' => 'Workspace#direct', 'url' => '/workspace/direct', 'verb' => 'GET'], + ['name' => 'Workspace#direct', 'url' => '/workspace/direct', 'verb' => 'POST'], ] ]; diff --git a/lib/Controller/WorkspaceController.php b/lib/Controller/WorkspaceController.php index 99658fc5a..46acbf2a7 100644 --- a/lib/Controller/WorkspaceController.php +++ b/lib/Controller/WorkspaceController.php @@ -176,12 +176,10 @@ class WorkspaceController extends OCSController { if ($folder instanceof Folder) { $file = $this->getFile($folder); if ($file === null) { + $token = $this->directEditingManager->create($path . '/'. self::SUPPORTED_FILENAMES[0], Application::APP_NAME, 'textdocument'); + } else { $token = $this->directEditingManager->open($file->getId(), Application::APP_NAME); - return new DataResponse([ - 'url' => $this->urlGenerator->linkToRouteAbsolute('files.DirectEditingView.edit', ['token' => $token]) - ]); } - $token = $this->directEditingManager->create($path . '/'. self::SUPPORTED_FILENAMES[0], Application::APP_NAME, 'textdocument'); return new DataResponse([ 'url' => $this->urlGenerator->linkToRouteAbsolute('files.DirectEditingView.edit', ['token' => $token]) ]); |