mirror of
https://github.com/nerzhul/ocsms.git
synced 2025-06-07 07:56:23 +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:
parent
f70fc2c080
commit
ca6ad6d071
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user