Use default best before date when adding product through API

This commit is contained in:
Marc Ole Bulling
2019-08-04 20:58:11 +02:00
parent 1a23eaabf1
commit 1e33975a96
2 changed files with 11 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ class StockApiController extends BaseApiController
throw new \Exception('An amount is required');
}
$bestBeforeDate = date('Y-m-d');
$bestBeforeDate = null;
if (array_key_exists('best_before_date', $requestBody) && IsIsoDate($requestBody['best_before_date']))
{
$bestBeforeDate = $requestBody['best_before_date'];