mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 18:54:35 +00:00
Fixed /stock/products/{productId}/add
request body parameter validation (fixes #1860)
This commit is contained in:
55
changelog/68_UNRELEASED_xxxx-xx-xx.md
Normal file
55
changelog/68_UNRELEASED_xxxx-xx-xx.md
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
> ⚠️ xxxBREAKING CHANGESxxx
|
||||||
|
|
||||||
|
> ❗ xxxImportant upgrade informationXXX
|
||||||
|
|
||||||
|
### New feature: xxxx
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Stock
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Shopping list
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Recipes
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Meal plan
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Chores
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Calendar
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Tasks
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Batteries
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Equipment
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### Userfields
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### General
|
||||||
|
|
||||||
|
- xxx
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
- Endpoint `/stock/products/{productId}/add`: Fixed that the request body parameter `transaction_type` was ignored / always set to `purchase`
|
@@ -130,9 +130,9 @@ class StockApiController extends BaseApiController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$transactionType = StockService::TRANSACTION_TYPE_PURCHASE;
|
$transactionType = StockService::TRANSACTION_TYPE_PURCHASE;
|
||||||
if (array_key_exists('transaction_type', $requestBody) && !empty($requestBody['transactiontype']))
|
if (array_key_exists('transaction_type', $requestBody) && !empty($requestBody['transaction_type']))
|
||||||
{
|
{
|
||||||
$transactionType = $requestBody['transactiontype'];
|
$transactionType = $requestBody['transaction_type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$stockLabelType = 0;
|
$stockLabelType = 0;
|
||||||
|
Reference in New Issue
Block a user