Adding hasElopage and publisherId logic, hasElopage is called and checks if in ElopageBuys their is a user with this email, if hasElopage and publisherId is filled store it in the user table.

This commit is contained in:
elweyn 2021-11-11 06:41:56 +01:00
parent 1baf756c08
commit e976c6854d

View File

@ -236,7 +236,10 @@ export class UserResolver {
user.pubkey = loginUserPubKeyString
user.language = loginUser.language
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) {