fix(android): MeRepository resolution — match project Api+body pattern

KSP couldn't resolve MeRepository despite the file being on disk +
imported correctly. Most likely cause: wire body data classes lived
in a separate file (MyProfileWire.kt) instead of the Api file —
diverged from the AdminUsersApi / PlaylistsApi / QuarantineApi
pattern where request bodies sit alongside the interface. Also
switched retrofit.create() to the explicit Java-class form in case
reified inference was the issue.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-26 21:03:56 -04:00
parent b1bcfe7fa3
commit a1b1eed740
2 changed files with 3 additions and 24 deletions
@@ -19,23 +19,3 @@ data class MyProfileWire(
val email: String? = null, val email: String? = null,
@SerialName("is_admin") val isAdmin: Boolean = false, @SerialName("is_admin") val isAdmin: Boolean = false,
) )
/**
* Body for `PUT /api/me/profile`. Pass only the fields you want to
* change; the server merges — empty strings clear, nulls leave
* existing values alone.
*/
@Serializable
data class UpdateProfileRequest(
@SerialName("display_name") val displayName: String? = null,
val email: String? = null,
)
/**
* Body for `PUT /api/me/password`. Both fields required.
*/
@Serializable
data class ChangePasswordRequest(
@SerialName("current_password") val currentPassword: String,
@SerialName("new_password") val newPassword: String,
)
@@ -1,12 +1,11 @@
package com.fabledsword.minstrel.settings.data package com.fabledsword.minstrel.settings.data
import com.fabledsword.minstrel.api.endpoints.ChangePasswordRequest
import com.fabledsword.minstrel.api.endpoints.MeApi import com.fabledsword.minstrel.api.endpoints.MeApi
import com.fabledsword.minstrel.api.endpoints.UpdateProfileRequest
import com.fabledsword.minstrel.models.MyProfile import com.fabledsword.minstrel.models.MyProfile
import com.fabledsword.minstrel.models.wire.ChangePasswordRequest
import com.fabledsword.minstrel.models.wire.MyProfileWire import com.fabledsword.minstrel.models.wire.MyProfileWire
import com.fabledsword.minstrel.models.wire.UpdateProfileRequest
import retrofit2.Retrofit import retrofit2.Retrofit
import retrofit2.create
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
@@ -19,7 +18,7 @@ import javax.inject.Singleton
*/ */
@Singleton @Singleton
class MeRepository @Inject constructor(retrofit: Retrofit) { class MeRepository @Inject constructor(retrofit: Retrofit) {
private val api: MeApi = retrofit.create() private val api: MeApi = retrofit.create(MeApi::class.java)
suspend fun getProfile(): MyProfile = api.getProfile().toDomain() suspend fun getProfile(): MyProfile = api.getProfile().toDomain()