mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
overwork update gms attributes, mocking gms still open
This commit is contained in:
parent
58e4c07244
commit
6c75705cc3
@ -562,6 +562,7 @@ export class UserResolver {
|
||||
`updateUserInfos(${firstName}, ${lastName}, ${alias}, ${language}, ***, ***, ${hideAmountGDD}, ${hideAmountGDT}, ${gmsAllowed}, ${gmsPublishName}, ${gmsLocation}, ${gmsPublishLocation})...`,
|
||||
)
|
||||
const user = getUser(context)
|
||||
const updateUserInGMS = compareGmsRelevantUserSettings(user, updateUserInfosArgs)
|
||||
|
||||
// try {
|
||||
if (firstName) {
|
||||
@ -645,7 +646,7 @@ export class UserResolver {
|
||||
await EVENT_USER_INFO_UPDATE(user)
|
||||
|
||||
// validate if user settings are changed with relevance to update gms-user
|
||||
if (CONFIG.GMS_ACTIVE && compareGmsRelevantUserSettings(user, updateUserInfosArgs)) {
|
||||
if (CONFIG.GMS_ACTIVE && updateUserInGMS) {
|
||||
logger.debug(`changed user-settings relevant for gms-user update...`)
|
||||
const homeCom = await getHomeCommunity()
|
||||
if (homeCom.gmsApiKey !== null) {
|
||||
|
||||
@ -2,6 +2,7 @@ import { Point } from '@dbTools/typeorm'
|
||||
import { User as DbUser } from '@entity/User'
|
||||
|
||||
import { UpdateUserInfosArgs } from '@/graphql/arg/UpdateUserInfosArgs'
|
||||
import { GmsPublishNameType } from '@/graphql/enum/GmsPublishNameType'
|
||||
import { LogError } from '@/server/LogError'
|
||||
import { backendLogger as logger } from '@/server/logger'
|
||||
|
||||
@ -15,7 +16,18 @@ export function compareGmsRelevantUserSettings(
|
||||
throw new LogError('comparison without any user is impossible')
|
||||
}
|
||||
logger.debug('compareGmsRelevantUserSettings:', orgUser, updateUserInfosArgs)
|
||||
if (updateUserInfosArgs.alias && orgUser.alias !== updateUserInfosArgs.alias) {
|
||||
// nach GMS updaten, wenn alias gesetzt wird oder ist und PublishLevel die alias-Übermittlung erlaubt
|
||||
if (
|
||||
updateUserInfosArgs.alias &&
|
||||
orgUser.alias !== updateUserInfosArgs.alias &&
|
||||
((updateUserInfosArgs.gmsPublishName &&
|
||||
updateUserInfosArgs.gmsPublishName.valueOf ===
|
||||
GmsPublishNameType.GMS_PUBLISH_NAME_ALIAS_OR_INITALS.valueOf) ||
|
||||
(!updateUserInfosArgs.gmsPublishName &&
|
||||
orgUser.gmsPublishName &&
|
||||
orgUser.gmsPublishName.valueOf ===
|
||||
GmsPublishNameType.GMS_PUBLISH_NAME_ALIAS_OR_INITALS.valueOf))
|
||||
) {
|
||||
return true
|
||||
}
|
||||
if (
|
||||
@ -24,7 +36,11 @@ export function compareGmsRelevantUserSettings(
|
||||
) {
|
||||
return true
|
||||
}
|
||||
if (updateUserInfosArgs.gmsAllowed && orgUser.gmsAllowed !== updateUserInfosArgs.gmsAllowed) {
|
||||
if (
|
||||
updateUserInfosArgs.gmsAllowed !== undefined &&
|
||||
updateUserInfosArgs.gmsAllowed &&
|
||||
orgUser.gmsAllowed !== updateUserInfosArgs.gmsAllowed
|
||||
) {
|
||||
return true
|
||||
}
|
||||
if (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user