minor code consolidation

This commit is contained in:
Bart Akeley 2018-11-24 10:42:54 -06:00
parent 47cf666f34
commit 6bb2dfd99b

View file

@ -38,10 +38,7 @@ const FoodRecordDefaults: FoodItem = {
const FoodItemRecord = Record(FoodRecordDefaults, 'FoodItemRecord');
export const createFoodItem = (foodItemRaw: ?RawFoodItem) => {
if (!foodItemRaw) {
return foodItemRaw;
}
return new FoodItemRecord({
return !foodItemRaw ? foodItemRaw : new FoodItemRecord({
...foodItemRaw,
placeId: foodItemRaw.placeid,
thumbImage: foodItemRaw.thumbimage,