Skip to content

Commit fd33f99

Browse files
authored
[Fix] Meal 구분자 " + " 에서 ", "로 변경 (#443)
* chore: Meal 구분자 " + " 에서 ", "로 변경 * chore: 구분자 상수화, mapNotNull 사용
1 parent 047c23e commit fd33f99

File tree

1 file changed

+3
-1
lines changed
  • app/src/main/java/com/eatssu/android/data/remote/dto/response

1 file changed

+3
-1
lines changed

app/src/main/java/com/eatssu/android/data/remote/dto/response/MealResponse.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package com.eatssu.android.data.remote.dto.response
33
import com.eatssu.android.domain.model.Menu
44
import com.google.gson.annotations.SerializedName
55

6+
private const val MENU_SEPARATOR = ", "
7+
68
data class GetMealResponse(
79
@SerializedName("mealId") var mealId: Long? = null,
810
@SerializedName("price") var price: Int? = null,
@@ -20,7 +22,7 @@ fun List<GetMealResponse>.mapTodayMenuResponseToMenu(): List<Menu> {
2022

2123
this.forEach { mealResponse ->
2224
val menuNames =
23-
mealResponse.briefMenus.joinToString(separator = " + ") { it.name ?: "" }
25+
mealResponse.briefMenus.mapNotNull { it.name }.joinToString(separator = MENU_SEPARATOR)
2426
val mealId = mealResponse.mealId ?: -1
2527
val price = mealResponse.price ?: 0
2628
val mainRating = mealResponse.rating ?: 0.0

0 commit comments

Comments
 (0)