mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 20:36:15 +02:00
change stock_row_id to id
This commit is contained in:
parent
94e35ef9fd
commit
3cc5e31794
|
|
@ -124,7 +124,7 @@ class StockApiController extends BaseApiController
|
|||
throw new \Exception('Request body could not be parsed (probably invalid JSON format or missing/wrong Content-Type header)');
|
||||
}
|
||||
|
||||
if (!array_key_exists('stock_row_id', $requestBody))
|
||||
if (!array_key_exists('id', $requestBody))
|
||||
{
|
||||
throw new \Exception('A stock row id is required');
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ class StockApiController extends BaseApiController
|
|||
$locationId = $requestBody['location_id'];
|
||||
}
|
||||
|
||||
$bookingId = $this->StockService->EditStock($requestBody['stock_row_id'], $requestBody['amount'], $bestBeforeDate, $locationId, $price);
|
||||
$bookingId = $this->StockService->EditStock($requestBody['id'], $requestBody['amount'], $bestBeforeDate, $locationId, $price);
|
||||
return $this->ApiResponse($this->Database->stock_log($bookingId));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
|
|
|
|||
|
|
@ -1063,10 +1063,10 @@
|
|||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"stock_row_id": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"format": "number",
|
||||
"description": "The Stock Row Id"
|
||||
"description": "The stock table id"
|
||||
},
|
||||
"amount": {
|
||||
"type": "number",
|
||||
|
|
@ -1090,7 +1090,7 @@
|
|||
}
|
||||
},
|
||||
"example": {
|
||||
"stock_row_id": 2,
|
||||
"id": 2,
|
||||
"amount": 1,
|
||||
"best_before_date": "2019-01-19",
|
||||
"location_id": 2,
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ $('#save-stockedit-button').on('click', function(e)
|
|||
var bookingResponse = null;
|
||||
|
||||
var stockRowId = GetUriParam('stockRowId');
|
||||
jsonData.stock_row_id = stockRowId;
|
||||
jsonData.id = stockRowId;
|
||||
|
||||
Grocy.Api.Put("stock", jsonData,
|
||||
function(result)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user