Skip to content

Commit 0e74c09

Browse files
Rename imageId to avatarId in AvatarService to match with other functions (#487)
1 parent 58419b7 commit 0e74c09

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

gravatar-quickeditor/src/test/java/com/gravatar/quickeditor/data/repository/AvatarRepositoryTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class AvatarRepositoryTest {
168168
val imageId = "imageId"
169169
coEvery { tokenStorage.getToken(any()) } returns "token"
170170
coEvery {
171-
avatarService.deleteAvatarCatching(imageId = "imageId", oauthToken = "token")
171+
avatarService.deleteAvatarCatching(avatarId = "imageId", oauthToken = "token")
172172
} returns GravatarResult.Success(Unit)
173173

174174
val result = avatarRepository.deleteAvatar(email, imageId)
@@ -182,7 +182,7 @@ class AvatarRepositoryTest {
182182
coEvery { tokenStorage.getToken(any()) } returns "token"
183183
coEvery {
184184
avatarService.deleteAvatarCatching(
185-
imageId = "imageId",
185+
avatarId = "imageId",
186186
oauthToken = "token",
187187
)
188188
} returns GravatarResult.Failure(ErrorType.Server)

gravatar/src/main/java/com/gravatar/services/AvatarService.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ public class AvatarService(private val okHttpClient: OkHttpClient? = null) {
174174
/**
175175
* Deletes the avatar with the given ID.
176176
*
177-
* @param imageId The ID of the avatar to delete
177+
* @param avatarId The ID of the avatar to delete
178178
* @param oauthToken The OAuth token to use for authentication
179179
*/
180-
public suspend fun deleteAvatar(imageId: String, oauthToken: String): Unit = runThrowingExceptionRequest {
180+
public suspend fun deleteAvatar(avatarId: String, oauthToken: String): Unit = runThrowingExceptionRequest {
181181
withContext(GravatarSdkDI.dispatcherIO) {
182182
val service = GravatarSdkDI.getGravatarV3Service(okHttpClient, oauthToken)
183183

184-
val response = service.deleteAvatar(imageId)
184+
val response = service.deleteAvatar(avatarId)
185185

186186
if (response.isSuccessful) {
187187
Unit
@@ -201,12 +201,12 @@ public class AvatarService(private val okHttpClient: OkHttpClient? = null) {
201201
* This method will catch any exception that occurs during
202202
* the execution and return it as a [GravatarResult.Failure].
203203
*
204-
* @param imageId The ID of the avatar to delete
204+
* @param avatarId The ID of the avatar to delete
205205
* @param oauthToken The OAuth token to use for authentication
206206
* @return The result of the operation
207207
*/
208-
public suspend fun deleteAvatarCatching(imageId: String, oauthToken: String): GravatarResult<Unit, ErrorType> =
208+
public suspend fun deleteAvatarCatching(avatarId: String, oauthToken: String): GravatarResult<Unit, ErrorType> =
209209
runCatchingRequest {
210-
deleteAvatar(imageId, oauthToken)
210+
deleteAvatar(avatarId, oauthToken)
211211
}
212212
}

0 commit comments

Comments
 (0)