Allow null value for recipe volume

This commit is contained in:
Christopher C. Wells 2021-04-20 18:51:51 -07:00
parent ef719c9175
commit f6fa2cf79f
1 changed files with 4 additions and 1 deletions

View File

@ -201,11 +201,14 @@ class RecipeController extends Controller
'description_delta' => $input['description_delta'],
'servings' => (int) $input['servings'],
'weight' => $input['weight'],
'volume' => Number::floatFromString($input['volume']),
'volume' => $input['volume'],
'time_prep' => (int) $input['time_prep'],
'time_cook' => (int) $input['time_cook'],
'source' => $input['source'],
]);
if (!empty($input['volume'])) {
$recipe->volume = Number::floatFromString($input['volume']);
}
try {
DB::transaction(function () use ($input, $recipe, $request) {