From 05f3742525282c4ea0fff5e6a0a3dea6ee8e2c29 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 4 Oct 2025 10:40:10 +0200 Subject: [PATCH] rollback --- backend/src/graphql/resolver/CommunityResolver.ts | 8 +------- backend/src/graphql/resolver/TransactionResolver.ts | 2 +- backend/test/helpers.ts | 6 ++---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/backend/src/graphql/resolver/CommunityResolver.ts b/backend/src/graphql/resolver/CommunityResolver.ts index c3604812e..675ec858f 100644 --- a/backend/src/graphql/resolver/CommunityResolver.ts +++ b/backend/src/graphql/resolver/CommunityResolver.ts @@ -78,24 +78,18 @@ export class CommunityResolver { if (homeCom.foreign) { throw new LogError('Error: Only the HomeCommunity could be modified!') } - if ( homeCom.gmsApiKey !== gmsApiKey || homeCom.location !== location || homeCom.hieroTopicId !== hieroTopicId ) { - // TODO: think about this, it is really expected to delete gmsApiKey if no new one is given? homeCom.gmsApiKey = gmsApiKey ?? null if (location) { homeCom.location = Location2Point(location) } - // update only with new value, don't overwrite existing value with null or undefined! - if (hieroTopicId) { - homeCom.hieroTopicId = hieroTopicId - } + homeCom.hieroTopicId = hieroTopicId ?? null await DbCommunity.save(homeCom) } - return new AdminCommunityView(homeCom) } } diff --git a/backend/src/graphql/resolver/TransactionResolver.ts b/backend/src/graphql/resolver/TransactionResolver.ts index fa6170013..a61356e29 100644 --- a/backend/src/graphql/resolver/TransactionResolver.ts +++ b/backend/src/graphql/resolver/TransactionResolver.ts @@ -447,7 +447,7 @@ export class TransactionResolver { recipientCommunityIdentifier, ) if (!recipientUser) { - throw new LogError('The recipient user was not found', { recipientIdentifier, recipientCommunityIdentifier }) + throw new LogError('The recipient user was not found', recipientUser) } logger.addContext('to', recipientUser?.id) if (recipientUser.foreign) { diff --git a/backend/test/helpers.ts b/backend/test/helpers.ts index ff0c513e7..c7f533931 100644 --- a/backend/test/helpers.ts +++ b/backend/test/helpers.ts @@ -39,13 +39,11 @@ export const testEnvironment = async (testLogger = getLogger('apollo'), testI18n } export const resetEntity = async (entity: any) => { - // delete data and reset autoincrement! - await entity.clear() - /*const items = await entity.find({ withDeleted: true }) + const items = await entity.find({ withDeleted: true }) if (items.length > 0) { const ids = items.map((e: any) => e.id) await entity.delete(ids) - }*/ + } } export const resetToken = () => {