diff --git a/backend/src/auth/RIGHTS.ts b/backend/src/auth/RIGHTS.ts index 30027086f..d26bdc702 100644 --- a/backend/src/auth/RIGHTS.ts +++ b/backend/src/auth/RIGHTS.ts @@ -35,7 +35,6 @@ export enum RIGHTS { UPDATE_CONTRIBUTION = 'UPDATE_CONTRIBUTION', LIST_CONTRIBUTION_LINKS = 'LIST_CONTRIBUTION_LINKS', COMMUNITY_STATISTICS = 'COMMUNITY_STATISTICS', - COMMUNITY_STATUS = 'COMMUNITY_STATUS', SEARCH_ADMIN_USERS = 'SEARCH_ADMIN_USERS', CREATE_CONTRIBUTION_MESSAGE = 'CREATE_CONTRIBUTION_MESSAGE', LIST_ALL_CONTRIBUTION_MESSAGES = 'LIST_ALL_CONTRIBUTION_MESSAGES', diff --git a/backend/src/auth/USER_RIGHTS.ts b/backend/src/auth/USER_RIGHTS.ts index 83ce9d871..3f08d1160 100644 --- a/backend/src/auth/USER_RIGHTS.ts +++ b/backend/src/auth/USER_RIGHTS.ts @@ -26,7 +26,6 @@ export const USER_RIGHTS = [ RIGHTS.SEARCH_ADMIN_USERS, RIGHTS.LIST_CONTRIBUTION_LINKS, RIGHTS.COMMUNITY_STATISTICS, - RIGHTS.COMMUNITY_STATUS, RIGHTS.CREATE_CONTRIBUTION_MESSAGE, RIGHTS.LIST_ALL_CONTRIBUTION_MESSAGES, RIGHTS.OPEN_CREATIONS, diff --git a/backend/src/federation/client/FederationClientFactory.ts b/backend/src/federation/client/FederationClientFactory.ts index 87794882d..926c3c180 100644 --- a/backend/src/federation/client/FederationClientFactory.ts +++ b/backend/src/federation/client/FederationClientFactory.ts @@ -4,7 +4,7 @@ import { FederationClient as V1_0_FederationClient } from '@/federation/client/1 import { FederationClient as V1_1_FederationClient } from '@/federation/client/1_1/FederationClient' import { ApiVersionType, ensureUrlEndsWithSlash } from 'core' -export type FederationClient = V1_0_FederationClient | V1_1_FederationClient +type FederationClient = V1_0_FederationClient | V1_1_FederationClient interface FederationClientInstance { id: number diff --git a/backend/src/graphql/model/Community.ts b/backend/src/graphql/model/Community.ts index 3163b886d..e5ccad59b 100644 --- a/backend/src/graphql/model/Community.ts +++ b/backend/src/graphql/model/Community.ts @@ -12,7 +12,6 @@ export class Community { this.creationDate = dbCom.creationDate this.uuid = dbCom.communityUuid this.authenticatedAt = dbCom.authenticatedAt - // this.gmsApiKey = dbCom.gmsApiKey // this.hieroTopicId = dbCom.hieroTopicId } @@ -40,10 +39,6 @@ export class Community { @Field(() => Date, { nullable: true }) authenticatedAt: Date | null - // gms api key should only seen by admins, they can use AdminCommunityView - // @Field(() => String, { nullable: true }) - // gmsApiKey: string | null - @Field(() => String, { nullable: true }) hieroTopicId: string | null } 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 = () => {