From 60015bc041c6bdac4b214c3b23d297e29c7b174a Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 27 Oct 2023 00:15:29 +0200 Subject: [PATCH] Return source for preference mutation (#728) --- .../suwayomi/tachidesk/graphql/mutations/SourceMutation.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/SourceMutation.kt b/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/SourceMutation.kt index a7911b8c..ad6371b9 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/SourceMutation.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/SourceMutation.kt @@ -10,12 +10,14 @@ import org.jetbrains.exposed.sql.transactions.transaction import suwayomi.tachidesk.graphql.types.FilterChange import suwayomi.tachidesk.graphql.types.MangaType import suwayomi.tachidesk.graphql.types.Preference +import suwayomi.tachidesk.graphql.types.SourceType import suwayomi.tachidesk.graphql.types.preferenceOf import suwayomi.tachidesk.graphql.types.updateFilterList import suwayomi.tachidesk.manga.impl.MangaList.insertOrGet import suwayomi.tachidesk.manga.impl.Source import suwayomi.tachidesk.manga.impl.util.source.GetCatalogueSource import suwayomi.tachidesk.manga.model.table.MangaTable +import suwayomi.tachidesk.manga.model.table.SourceTable import suwayomi.tachidesk.server.JavalinSetup.future import java.util.concurrent.CompletableFuture @@ -100,6 +102,7 @@ class SourceMutation { data class UpdateSourcePreferencePayload( val clientMutationId: String?, val preferences: List, + val source: SourceType, ) fun updateSourcePreference(input: UpdateSourcePreferenceInput): UpdateSourcePreferencePayload { @@ -119,6 +122,10 @@ class SourceMutation { return UpdateSourcePreferencePayload( clientMutationId = clientMutationId, preferences = Source.getSourcePreferencesRaw(sourceId).map { preferenceOf(it) }, + source = + transaction { + SourceType(SourceTable.select { SourceTable.id eq sourceId }.first())!! + }, ) } }