Co-authored-by: ronia <ronia@m57>
This commit is contained in:
1 parent
261ee6379a
commit
113467a99d
3 files changed
+8
-6
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package com.m57.hermescontrol.data.model
|
||||
|
||||
data class SaveSkillContentRequest(
|
||||
val name: String,
|
||||
val content: String,
|
||||
)
|
||||
@@ -54,14 +54,13 @@ import retrofit2.http.Path
|
||||
import retrofit2.http.Query
|
||||
|
||||
interface HermesApiService {
|
||||
@GET("api/skills/{name}/content")
|
||||
@GET("api/skills/content")
|
||||
suspend fun getSkillContent(
|
||||
@Path("name") name: String,
|
||||
@Query("name") name: String,
|
||||
): Response<SkillContentResponse>
|
||||
|
||||
@PUT("api/skills/{name}/content")
|
||||
@PUT("api/skills/content")
|
||||
suspend fun saveSkillContent(
|
||||
@Path("name") name: String,
|
||||
@Body body: SaveSkillContentRequest,
|
||||
): Response<Unit>
|
||||
|
||||
|
||||
@@ -143,9 +143,11 @@ class SkillsViewModel : ViewModel() {
|
||||
withContext(Dispatchers.IO) {
|
||||
safeApiCall {
|
||||
ApiClient.hermesApi.saveSkillContent(
|
||||
skillName,
|
||||
com.m57.hermescontrol.data.model
|
||||
.SaveSkillContentRequest(content),
|
||||
.SaveSkillContentRequest(
|
||||
name = skillName,
|
||||
content = content,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user