Rework API to be more RESTful (references #139)

This commit is contained in:
Bernd Bestel
2019-01-19 14:51:51 +01:00
parent 0ce8d706a6
commit bfa59dd29c
52 changed files with 1110 additions and 1143 deletions

View File

@@ -8,7 +8,7 @@
Grocy.Api.Get('chores/' + jsonForm.chore_id,
function (choreDetails)
{
Grocy.Api.Post('chores/' + jsonForm.chore_id + '/execute?tracked_time=' + Grocy.Components.DateTimePicker.GetValue() + "&done_by=" + Grocy.Components.UserPicker.GetValue(),
Grocy.Api.Post('chores/' + jsonForm.chore_id + '/execute', { 'tracked_time': Grocy.Components.DateTimePicker.GetValue(), 'done_by': Grocy.Components.UserPicker.GetValue() },
function(result)
{
Grocy.FrontendHelpers.EndUiBusy("choretracking-form");
@@ -89,7 +89,7 @@ Grocy.Components.DateTimePicker.GetInputElement().on('keypress', function(e)
function UndoChoreExecution(executionId)
{
Grocy.Api.Post('chores/' + executionId.toString() + '/undo',
Grocy.Api.Post('chores/' + executionId.toString() + '/undo', { },
function(result)
{
toastr.success(L("Chore execution successfully undone"));