Skip to content

Commit 423c125

Browse files
committed
use OC.generateUrl() to generate the post queries for start and stop
fixes #169
1 parent 1cc3ada commit 423c125

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

js/src/timer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,12 +558,12 @@ function() {
558558
stopTimer(startTimer, [projectId, tags]);
559559
return;
560560
}
561-
var baseUrl = OC.generateUrl('/apps/timetracker/ajax/start-timer');
562561
var workName = $('#work-input').val();
563562
if (workName == ''){
564563
workName = 'no description';
565564
}
566-
var jqxhr = $.post( "ajax/start-timer/"+encodeURIComponent(encodeURIComponent(workName)), { projectId: projectId, tags: tags}, function() {
565+
var baseUrl = OC.generateUrl('/apps/timetracker/ajax/start-timer/'+encodeURIComponent(encodeURIComponent(workName)));
566+
var jqxhr = $.post(baseUrl, { projectId: projectId, tags: tags}, function() {
567567
})
568568
.done(function(data, status, jqXHR) {
569569
var response = data;
@@ -587,7 +587,8 @@ function() {
587587
if (workName == ''){
588588
workName = 'no description';
589589
}
590-
var jqxhr = $.post( "ajax/stop-timer/"+encodeURIComponent(encodeURIComponent(workName)), function() { // encode twice so we can pass / character
590+
var baseUrl = OC.generateUrl('/apps/timetracker/ajax/stop-timer/'+encodeURIComponent(encodeURIComponent(workName)));
591+
var jqxhr = $.post(baseUrl, function() { // encode twice so we can pass / character
591592
})
592593
.done(function(data, status, jqXHR) {
593594
var response = data;

0 commit comments

Comments
 (0)