This commit is contained in:
einhornimmond 2025-10-04 10:40:10 +02:00
parent ba6a390c7a
commit 05f3742525
3 changed files with 4 additions and 12 deletions

View File

@ -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)
}
}

View File

@ -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) {

View File

@ -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 = () => {