Skip to content

Commit

Permalink
[MOD/#198] 문자열 상수 추출
Browse files Browse the repository at this point in the history
  • Loading branch information
angryPodo committed Feb 17, 2025
1 parent 28798fb commit fbce724
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ class RegisterRepositoryImpl @Inject constructor(

coroutineScope {
val requestBody = Json.encodeToString(RegisterPostRequestDto.serializer(), requestDto)
.toRequestBody("application/json".toMediaType())
.toRequestBody(MEDIA_TYPE_JSON.toMediaType())

val photoParts = photos.map { uri ->
async {
ContentUriRequestBody(context, uri)
.apply { prepareImage() }
.toFormData("photos")
.toFormData(FORM_DATA_NAME_PHOTOS)
}
}

Expand All @@ -90,4 +90,9 @@ class RegisterRepositoryImpl @Inject constructor(
}
}
}

companion object {
private const val MEDIA_TYPE_JSON = "application/json"
private const val FORM_DATA_NAME_PHOTOS = "photos"
}
}

0 comments on commit fbce724

Please sign in to comment.