mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Don't load or save userfields if there are none (references #176)
This commit is contained in:
parent
dae5bb2b34
commit
dfd501c515
@ -2,6 +2,16 @@ Grocy.Components.UserfieldsForm = { };
|
||||
|
||||
Grocy.Components.UserfieldsForm.Save = function(success, error)
|
||||
{
|
||||
if (!$("#userfields-form").length)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
success();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var jsonData = { };
|
||||
|
||||
$("#userfields-form .userfield-input").each(function()
|
||||
@ -44,6 +54,16 @@ Grocy.Components.UserfieldsForm.Save = function(success, error)
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load = function()
|
||||
{
|
||||
if (!$("#userfields-form").length)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
success();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Grocy.Api.Get('userfields/' + $("#userfields-form").data("entity") + '/' + Grocy.EditObjectId,
|
||||
function(result)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user