mirror of
https://github.com/nextcloud/ocsms.git
synced 2026-08-11 16:32:55 +00:00
Don't use OC.generateUrl to generate API endpoint URLs
OC.generateUrl doesn't permit to know applications endpoint for this app, instead use window.location.href to retrieve the app current URL and generate endpoints from this This fixes issue #197
This commit is contained in:
+6
-1
@@ -105,7 +105,12 @@ app.controller('OcSmsController', ['$scope', '$interval', '$timeout', '$compile'
|
||||
$scope.lastSearch = '';
|
||||
|
||||
$scope.generateUrl = function (endpoint) {
|
||||
return OC.generateUrl('/apps/ocsms' + endpoint);
|
||||
var winRegexp = /(.*)\/ocsms.*/;
|
||||
var match = winRegexp.exec(window.location.href);
|
||||
if (match.length != 2) {
|
||||
console.log("A very bad error happened when parsing window location");
|
||||
}
|
||||
return match[1] + '/ocsms' + endpoint;
|
||||
};
|
||||
|
||||
// Settings
|
||||
|
||||
Reference in New Issue
Block a user