diff options
author | Joas Schilling <coding@schilljs.com> | 2021-08-19 13:11:58 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-08-31 12:57:59 +0200 |
commit | 243098a96f4a5eb4707bf434720c1d0e2b0e9a20 (patch) | |
tree | 23c5bb34c08556522c779c6a58e7cbf1cd2cf8fb | |
parent | 40d4ff3704edae787dbe9150b9e41b6d191e9925 (diff) | |
download | nextcloud-server-243098a96f4a5eb4707bf434720c1d0e2b0e9a20.tar.gz nextcloud-server-243098a96f4a5eb4707bf434720c1d0e2b0e9a20.zip |
Revert OC.linkToOCS() calls back to old behaviour
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r-- | apps/files_external/js/mountsfilelist.js | 2 | ||||
-rw-r--r-- | apps/files_external/js/statusmanager.js | 6 | ||||
-rw-r--r-- | apps/files_external/tests/js/mountsfilelistSpec.js | 2 | ||||
-rw-r--r-- | apps/files_sharing/js/app.js | 6 | ||||
-rw-r--r-- | apps/files_sharing/js/sharedfilelist.js | 10 | ||||
-rw-r--r-- | apps/settings/js/apps.js | 2 | ||||
-rw-r--r-- | apps/settings/js/settings.js | 2 | ||||
-rw-r--r-- | apps/settings/js/settings/personalInfo.js | 4 |
8 files changed, 17 insertions, 17 deletions
diff --git a/apps/files_external/js/mountsfilelist.js b/apps/files_external/js/mountsfilelist.js index d3059309b95..b2e25e4ccd9 100644 --- a/apps/files_external/js/mountsfilelist.js +++ b/apps/files_external/js/mountsfilelist.js @@ -92,7 +92,7 @@ this._setCurrentDir('/', false); this._reloadCall = $.ajax({ - url: OC.linkToOCS('apps/files_external/api/v1/mounts'), + url: OC.linkToOCS('apps/files_external/api/v1', 2) + 'mounts', data: { format: 'json' }, diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js index 8985edd968a..d77f056cf1d 100644 --- a/apps/files_external/js/statusmanager.js +++ b/apps/files_external/js/statusmanager.js @@ -141,7 +141,7 @@ OCA.Files_External.StatusManager = { self.isGetMountPointListRunning = true; $.ajax({ type: 'GET', - url: OC.linkToOCS('apps/files_external/api/v1/mounts?format=json'), + url: OC.linkToOCS('apps/files_external/api/v1') + 'mounts?format=json', success: function (response) { self.mountPointList = []; _.each(response.ocs.data, function (mount) { @@ -159,7 +159,7 @@ OCA.Files_External.StatusManager = { }, error: function (jqxhr, state, error) { self.mountPointList = []; - OC.Notification.show(t('files_external', 'Couldn\'t get the list of external mount points: {type}', + OC.Notification.show(t('files_external', 'Couldn\'t get the list of external mount points: {type}', {type: error}), {type: 'error'} ); }, @@ -271,7 +271,7 @@ OCA.Files_External.StatusManager = { // check if we have a list first if (list === undefined && !self.emptyWarningShown) { self.emptyWarningShown = true; - OC.Notification.show(t('files_external', 'Couldn\'t fetch list of Windows network drive mount points: Empty response from server'), + OC.Notification.show(t('files_external', 'Couldn\'t fetch list of Windows network drive mount points: Empty response from server'), {type: 'error'} ); return; diff --git a/apps/files_external/tests/js/mountsfilelistSpec.js b/apps/files_external/tests/js/mountsfilelistSpec.js index 66357448147..6068326ee28 100644 --- a/apps/files_external/tests/js/mountsfilelistSpec.js +++ b/apps/files_external/tests/js/mountsfilelistSpec.js @@ -117,7 +117,7 @@ describe('OCA.Files_External.FileList tests', function() { expect(fakeServer.requests.length).toEqual(1); request = fakeServer.requests[0]; expect(request.url).toEqual( - OC.linkToOCS('apps/files_external/api/v1/mounts?format=json') + OC.linkToOCS('apps/files_external/api/v1') + 'mounts?format=json' ); fakeServer.requests[0].respond( diff --git a/apps/files_sharing/js/app.js b/apps/files_sharing/js/app.js index ef08315c488..cf1a489b6f2 100644 --- a/apps/files_sharing/js/app.js +++ b/apps/files_sharing/js/app.js @@ -276,7 +276,7 @@ OCA.Sharing.App = { type: OCA.Files.FileActions.TYPE_INLINE, actionHandler(fileName, context) { const shareId = context.$file.data('shareId') - $.post(OC.linkToOCS('apps/files_sharing/api/v1/deletedshares/{shareId}', { shareId })) + $.post(OC.linkToOCS('apps/files_sharing/api/v1/deletedshares', 2) + shareId) .success(function(result) { context.fileList.remove(context.fileInfoModel.attributes.name) }).fail(function() { @@ -302,7 +302,7 @@ OCA.Sharing.App = { if (context.$file.attr('data-remote-id')) { shareBase = 'remote_shares/pending' } - $.post(OC.linkToOCS('apps/files_sharing/api/v1/' + shareBase + '/{shareId}', { shareId })) + $.post(OC.linkToOCS('apps/files_sharing/api/v1/shares/pending', 2) + shareId) .success(function(result) { context.fileList.remove(context.fileInfoModel.attributes.name) }).fail(function() { @@ -333,7 +333,7 @@ OCA.Sharing.App = { } $.ajax({ - url: OC.linkToOCS('apps/files_sharing/api/v1/' + shareBase + '/{shareId}', { shareId }), + url: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + shareId, type: 'DELETE', }).success(function(result) { context.fileList.remove(context.fileInfoModel.attributes.name) diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index ed2a730549b..4e364f92077 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -196,7 +196,7 @@ var promises = [] var deletedShares = { - url: OC.linkToOCS('apps/files_sharing/api/v1/deletedshares'), + url: OC.linkToOCS('apps/files_sharing/api/v1', 2) + 'deletedshares', /* jshint camelcase: false */ data: { format: 'json', @@ -209,7 +209,7 @@ } var pendingShares = { - url: OC.linkToOCS('apps/files_sharing/api/v1/shares/pending'), + url: OC.linkToOCS('apps/files_sharing/api/v1/shares', 2) + 'pending', /* jshint camelcase: false */ data: { format: 'json' @@ -221,7 +221,7 @@ } var pendingRemoteShares = { - url: OC.linkToOCS('apps/files_sharing/api/v1/remote_shares/pending'), + url: OC.linkToOCS('apps/files_sharing/api/v1/remote_shares', 2) + 'pending', /* jshint camelcase: false */ data: { format: 'json' @@ -233,7 +233,7 @@ } var shares = { - url: OC.linkToOCS('apps/files_sharing/api/v1/shares'), + url: OC.linkToOCS('apps/files_sharing/api/v1') + 'shares', /* jshint camelcase: false */ data: { format: 'json', @@ -247,7 +247,7 @@ } var remoteShares = { - url: OC.linkToOCS('apps/files_sharing/api/v1/remote_shares'), + url: OC.linkToOCS('apps/files_sharing/api/v1') + 'remote_shares', /* jshint camelcase: false */ data: { format: 'json', diff --git a/apps/settings/js/apps.js b/apps/settings/js/apps.js index 0685509e59f..a3c1650e445 100644 --- a/apps/settings/js/apps.js +++ b/apps/settings/js/apps.js @@ -2,7 +2,7 @@ OC.Settings = OC.Settings || {}; OC.Settings.Apps = OC.Settings.Apps || { rebuildNavigation: function() { - $.getJSON(OC.linkToOCS('core/navigation/apps?format=json')).done(function(response){ + $.getJSON(OC.linkToOCS('core/navigation', 2) + 'apps?format=json').done(function(response){ if(response.ocs.meta.status === 'ok') { var addedApps = {}; var navEntries = response.ocs.data; diff --git a/apps/settings/js/settings.js b/apps/settings/js/settings.js index 9658d64dd16..6f29b3fc58c 100644 --- a/apps/settings/js/settings.js +++ b/apps/settings/js/settings.js @@ -35,7 +35,7 @@ OC.Settings = _.extend(OC.Settings, { if ($elements.length > 0) { // Let's load the data and THEN init our select $.ajax({ - url: OC.linkToOCS('cloud/groups/details'), + url: OC.linkToOCS('cloud/groups', 2) + 'details', dataType: 'json', success: function(data) { var results = []; diff --git a/apps/settings/js/settings/personalInfo.js b/apps/settings/js/settings/personalInfo.js index 2e57537d424..1e2a8d58ab9 100644 --- a/apps/settings/js/settings/personalInfo.js +++ b/apps/settings/js/settings/personalInfo.js @@ -222,7 +222,7 @@ window.addEventListener('DOMContentLoaded', function () { user = OC.getCurrentUser(); $.ajax({ - url: OC.linkToOCS('cloud/users/{uid}', { uid: user.uid }), + url: OC.linkToOCS('cloud/users', 2) + user['uid'], method: 'PUT', data: { key: 'language', @@ -248,7 +248,7 @@ window.addEventListener('DOMContentLoaded', function () { user = OC.getCurrentUser(); $.ajax({ - url: OC.linkToOCS('cloud/users/{uid}', { uid: user.uid }), + url: OC.linkToOCS('cloud/users', 2) + user.uid, method: 'PUT', data: { key: 'locale', |