From e97798d73c780f6a7c16870e1f04b64f20c255e4 Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 11 Nov 2021 06:42:27 +0100 Subject: [PATCH] Withdrew comments. --- backend/src/graphql/resolver/UserResolver.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/backend/src/graphql/resolver/UserResolver.ts b/backend/src/graphql/resolver/UserResolver.ts index 8462df819..ee44346e7 100644 --- a/backend/src/graphql/resolver/UserResolver.ts +++ b/backend/src/graphql/resolver/UserResolver.ts @@ -31,7 +31,6 @@ import { LoginElopageBuys } from '@entity/LoginElopageBuys' import { LoginUserBackup } from '@entity/LoginUserBackup' import { LoginEmailOptIn } from '@entity/LoginEmailOptIn' import { sendEMail } from '../../util/sendEMail' -import { LoginElopageBuysRepository } from '../../typeorm/repository/LoginElopageBuys' // eslint-disable-next-line @typescript-eslint/no-var-requires const sodium = require('sodium-native') @@ -235,24 +234,13 @@ export class UserResolver { user.description = loginUser.description user.pubkey = loginUserPubKeyString user.language = loginUser.language + + // Elopage Status & Stored PublisherId user.hasElopage = await this.hasElopage({ pubkey: loginUser.pubKey }) if (!user.hasElopage && publisherId) { user.publisherId = publisherId await this.updateUserInfos({ publisherId }, { pubKey: loginUser.pubKey }) } - // TODO: Get Method from PR (publisherId) - // Hack: Database Field is not validated properly and not nullable - // if (user.publisherId === 0) { - // user.publisherId = undefined - // } - // Save publisherId if Elopage is not yet registered - // if (!user.hasElopage && publisherId) { - // user.publisherId = publisherId - // await this.updateUserInfos( - // { publisherId }, - // { sessionId: result.data.session_id, pubKey: result.data.user.public_hex }, - // ) - // } // coinAnimation const userSettingRepository = getCustomRepository(UserSettingRepository) @@ -600,7 +588,6 @@ export class UserResolver { @Authorized() @Query(() => Boolean) async hasElopage(@Ctx() context: any): Promise { - // const result = await apiGet(CONFIG.LOGIN_API_URL + 'hasElopage?session_id=' + context.sessionId) const userRepository = getCustomRepository(UserRepository) const userEntity = await userRepository.findByPubkeyHex(context.pubKey).catch() if (!userEntity) {