Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move lock/unlock API endpoints to OCS
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Mar 10, 2022
commit b1f6d0630ec11afae4606fafa6d960a732fa8dee
3 changes: 1 addition & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Allow your users to temporary lock their files to avoid conflicts while working
</commands>

<dependencies>
<nextcloud min-version="21" max-version="23"/>
<nextcloud min-version="21" max-version="24"/>
</dependencies>

</info>
2 changes: 1 addition & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


return [
'routes' => [
'ocs' => [
['name' => 'Lock#locking', 'url' => '/lock/{fileId}', 'verb' => 'PUT'],
['name' => 'Lock#unlocking', 'url' => '/lock/{fileId}', 'verb' => 'DELETE'],
]
Expand Down
4 changes: 2 additions & 2 deletions js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
if (locked !== undefined && locked) {
$.ajax({
method: 'DELETE',
url: OC.generateUrl('/apps/files_lock/lock/' + fileId)
url: OC.linkToOCS('/apps/files_lock/lock', 2) + fileId
}).done(function(res) {
model.set('locked', false)
}).fail(function(res) {
Expand All @@ -125,7 +125,7 @@
} else {
$.ajax({
method: 'PUT',
url: OC.generateUrl('/apps/files_lock/lock/' + fileId)
url: OC.linkToOCS('/apps/files_lock/lock', 2) + fileId
}).done(function(res) {
model.set('locked', true)
model.set('lockOwner', OC.getCurrentUser().uid)
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/LockController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
use OCA\FilesLock\Service\FileService;
use OCA\FilesLock\Service\LockService;
use OCA\FilesLock\Tools\Traits\TLogger;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\IRequest;
use OCP\IUserSession;

Expand All @@ -47,7 +47,7 @@
*
* @package OCA\FilesLock\Controller
*/
class LockController extends Controller {
class LockController extends OCSController {


use TLogger;
Expand Down