Skip to content

Commit 9393d3d

Browse files
committed
Merge branch 'master' into develop
2 parents 023315c + 0fb1d3f commit 9393d3d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

app/External/Model/Ingredient.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,19 @@ public static function fromCSV(array $sourceArray): self
150150
name: $sourceArray['name'],
151151
parentId: null,
152152
strength: isset($sourceArray['strength']) ? floatval($sourceArray['strength']) : 0.0,
153-
description: blank($sourceArray['description']) ? null : $sourceArray['description'],
154-
origin: blank($sourceArray['origin']) ? null : $sourceArray['origin'],
155-
color: blank($sourceArray['color']) ? null : $sourceArray['color'],
153+
description: blank($sourceArray['description'] ?? null) ? null : $sourceArray['description'],
154+
origin: blank($sourceArray['origin'] ?? null) ? null : $sourceArray['origin'],
155+
color: blank($sourceArray['color'] ?? null) ? null : $sourceArray['color'],
156156
createdAt: null,
157157
updatedAt: null,
158158
images: [],
159159
ingredientParts: [],
160160
prices: [],
161161
calculatorId: null,
162-
sugarContent: blank($sourceArray['sugar_g_per_ml']) ? null : $sourceArray['sugar_g_per_ml'],
163-
acidity: blank($sourceArray['acidity']) ? null : $sourceArray['acidity'],
164-
distillery: blank($sourceArray['distillery']) ? null : $sourceArray['distillery'],
165-
units: blank($sourceArray['units']) ? null : new UnitValueObject($sourceArray['units']),
162+
sugarContent: blank($sourceArray['sugar_g_per_ml'] ?? null) ? null : $sourceArray['sugar_g_per_ml'],
163+
acidity: blank($sourceArray['acidity'] ?? null) ? null : $sourceArray['acidity'],
164+
distillery: blank($sourceArray['distillery'] ?? null) ? null : $sourceArray['distillery'],
165+
units: blank($sourceArray['units'] ?? null) ? null : new UnitValueObject($sourceArray['units']),
166166
);
167167
}
168168

routes/api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223

224224
Route::prefix('import')->middleware(['throttle:importing'])->group(function () {
225225
Route::post('/scrape', [ImportController::class, 'scrape'])->middleware([EnsureRequestHasBarQuery::class, 'ability:cocktails.import'])->name('import.scrape');
226-
Route::post('/cocktail', [ImportController::class, 'cocktail'])->middleware([EnsureRequestHasBarQuery::class, 'ability:*'])->name('import.cocktail');
226+
Route::post('/cocktail', [ImportController::class, 'cocktail'])->middleware([EnsureRequestHasBarQuery::class, 'ability:cocktails.import'])->name('import.cocktail');
227227
Route::post('/file', [ImportController::class, 'file'])->middleware([EnsureRequestHasBarQuery::class, 'ability:*'])->name('import.file');
228228
Route::post('/ingredients', [ImportController::class, 'ingredients'])->middleware([EnsureRequestHasBarQuery::class, 'ability:*'])->name('import.ingredients');
229229
});

0 commit comments

Comments
 (0)