Server & Client move the tags into a separate branch

This commit is contained in:
Andres Gomez, Thomas (ITDV RL) 2025-04-04 13:44:44 +02:00
parent 57c535afd6
commit 4ac30fd9b5
12 changed files with 102 additions and 105 deletions

View file

@ -26,8 +26,6 @@ interface LwaClient {
alterationId: String,
): APIResponse<Unit>
suspend fun getAlterationTags(): APIResponse<List<TagJson>>
// Campaign
suspend fun getCampaign(): APIResponse<CampaignJson>
@ -52,8 +50,6 @@ interface LwaClient {
suspend fun getCharacters(): APIResponse<List<CharacterPreviewJson>>
suspend fun getCharacterTags(): APIResponse<List<TagJson>>
suspend fun getCharacter(
characterSheetId: String,
): APIResponse<CharacterSheetJson>
@ -87,6 +83,12 @@ interface LwaClient {
characterSheetId: String,
): APIResponse<Unit>
// Tags
suspend fun getAlterationTags(): APIResponse<List<TagJson>>
suspend fun getCharacterTags(): APIResponse<List<TagJson>>
companion object {
fun error(error: APIResponse<*>): Nothing = throw LwaNetworkException(error)
}

View file

@ -50,11 +50,6 @@ class LwaClientImpl(
.delete("$root/alteration/delete?alterationId=$alterationId")
.body<APIResponse<Unit>>()
@Throws
override suspend fun getAlterationTags(): APIResponse<List<TagJson>> = client
.get("$root/alteration/tags")
.body()
@Throws
override suspend fun getCampaign(): APIResponse<CampaignJson> = client
.get("$root/campaign")
@ -93,11 +88,6 @@ class LwaClientImpl(
.get("$root/character/all")
.body()
@Throws
override suspend fun getCharacterTags(): APIResponse<List<TagJson>> = client
.get("$root/character/tags")
.body()
@Throws
override suspend fun getCharacter(
characterSheetId: String,
@ -152,4 +142,14 @@ class LwaClientImpl(
override suspend fun deleteCharacterSheet(characterSheetId: String) = client
.delete("$root/character/delete?characterSheetId=$characterSheetId")
.body<APIResponse<Unit>>()
@Throws
override suspend fun getAlterationTags(): APIResponse<List<TagJson>> = client
.get("$root/tag/alteration")
.body()
@Throws
override suspend fun getCharacterTags(): APIResponse<List<TagJson>> = client
.get("$root/tag/character")
.body()
}