stockdetail refresh with location name

This commit is contained in:
Kurt Riddlesperger 2020-01-15 17:30:43 -06:00
parent 17c3776b09
commit 36a6c56f5c

View File

@ -249,11 +249,20 @@ function RefreshStockDetailRow(stockRowId)
$(this).text(result.best_before_date).fadeIn(500);
});
var locationName = "";
Grocy.Api.Get("objects/locations/" + result.location_id,
function(locationResult)
{
locationName = locationResult.name;
},
function(xhr)
{
console.error(xhr);
});
$('#stock-' + stockRowId + '-location').parent().effect('highlight', { }, 500);
$('#stock-' + stockRowId + '-location').fadeOut(500, function()
{
//TODO grab location name instead of id
$(this).text(result.location_id).fadeIn(500);
$(this).text(locationName).fadeIn(500);
});
$('#stock-' + stockRowId + '-price').parent().effect('highlight', { }, 500);