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:
@@ -19,23 +19,3 @@ data class MyProfileWire(
|
||||
val email: String? = null,
|
||||
@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
|
||||
|
||||
import com.fabledsword.minstrel.api.endpoints.ChangePasswordRequest
|
||||
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.wire.ChangePasswordRequest
|
||||
import com.fabledsword.minstrel.models.wire.MyProfileWire
|
||||
import com.fabledsword.minstrel.models.wire.UpdateProfileRequest
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.create
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
|
||||
@@ -19,7 +18,7 @@ import javax.inject.Singleton
|
||||
*/
|
||||
@Singleton
|
||||
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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user