set field type on creating new userContact

This commit is contained in:
clauspeterhuebner 2025-12-16 23:28:05 +01:00
parent bb69008f5f
commit 093a2d4745

View File

@ -6,6 +6,7 @@ import { getLogger } from 'log4js'
import { LOG4JS_BASE_CATEGORY_NAME } from '../../config/const' import { LOG4JS_BASE_CATEGORY_NAME } from '../../config/const'
import { SendCoinsResult } from '../../federation/client/1_0/model/SendCoinsResult' import { SendCoinsResult } from '../../federation/client/1_0/model/SendCoinsResult'
import { UserLoggingView, UserContactLoggingView } from 'database' import { UserLoggingView, UserContactLoggingView } from 'database'
import { UserContactType } from 'shared'
const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.graphql.logic.storeForeignUser`) const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.graphql.logic.storeForeignUser`)
@ -78,6 +79,7 @@ export async function storeForeignUser(
if(!user.emailContact && committingResult.recipEmail !== null) { if(!user.emailContact && committingResult.recipEmail !== null) {
logger.debug('creating new userContact:', new UserContactLoggingView(user.emailContact), committingResult) logger.debug('creating new userContact:', new UserContactLoggingView(user.emailContact), committingResult)
let foreignUserEmail = DbUserContact.create() let foreignUserEmail = DbUserContact.create()
foreignUserEmail.type = UserContactType.USER_CONTACT_EMAIL
foreignUserEmail.email = committingResult.recipEmail! foreignUserEmail.email = committingResult.recipEmail!
foreignUserEmail.emailChecked = true foreignUserEmail.emailChecked = true
foreignUserEmail.user = user foreignUserEmail.user = user