fix(android): MeApi — move request bodies inline (project pattern)
a1b1eed moved the body data classes out of MyProfileWire.kt but the
MeApi.kt write didn't land (stale Read), so MeApi was still trying
to import them from models.wire where they no longer exist. Inline
them in MeApi.kt matching the AdminUsersApi / PlaylistsApi /
QuarantineApi pattern (where request bodies live alongside the
interface).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package com.fabledsword.minstrel.api.endpoints
|
||||
|
||||
import com.fabledsword.minstrel.models.wire.ChangePasswordRequest
|
||||
import com.fabledsword.minstrel.models.wire.MyProfileWire
|
||||
import com.fabledsword.minstrel.models.wire.UpdateProfileRequest
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.PUT
|
||||
@@ -34,3 +34,23 @@ interface MeApi {
|
||||
@PUT("api/me/password")
|
||||
suspend fun changePassword(@Body body: ChangePasswordRequest)
|
||||
}
|
||||
|
||||
/**
|
||||
* 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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user