Finish first version of tasks feature

This commit is contained in:
Bernd Bestel
2018-09-23 19:26:13 +02:00
parent f85a67a1ff
commit 06f25b7006
16 changed files with 239 additions and 24 deletions

View File

@@ -2,9 +2,14 @@
{
e.preventDefault();
var jsonData = $('#task-form').serializeJSON();
jsonData.assigned_to_user_id = jsonData.user_id;
delete jsonData.user_id;
jsonData.due_date = Grocy.Components.DateTimePicker.GetValue();
if (Grocy.EditMode === 'create')
{
Grocy.Api.Post('add-object/tasks', $('#task-form').serializeJSON(),
Grocy.Api.Post('add-object/tasks', jsonData,
function(result)
{
window.location.href = U('/tasks');
@@ -17,7 +22,7 @@
}
else
{
Grocy.Api.Post('edit-object/tasks/' + Grocy.EditObjectId, $('#task-form').serializeJSON(),
Grocy.Api.Post('edit-object/tasks/' + Grocy.EditObjectId, jsonData,
function(result)
{
window.location.href = U('/tasks');