From c24d5488a351b9f63e46280989a8dc7537f9e851 Mon Sep 17 00:00:00 2001 From: Jasmin Date: Mon, 26 Aug 2024 11:31:20 +0200 Subject: [PATCH] fix: small fixes --- src/inventory/inventory.service.ts | 2 +- src/oauth/epic.service.ts | 1 + src/oauth/steam.service.ts | 6 ++---- src/users/users.service.ts | 2 ++ src/witchit/witchIt.service.ts | 4 ---- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/inventory/inventory.service.ts b/src/inventory/inventory.service.ts index 5cad6c5..2858f29 100644 --- a/src/inventory/inventory.service.ts +++ b/src/inventory/inventory.service.ts @@ -104,7 +104,7 @@ export class InventoryService { } } - if (!user.steamProfileLink || !user.witchItUserId) { + if (!user.witchItUserId) { throw new HttpException( `You need to have your Witch It Id linked to be able to sync your witch it inventory. Please configure this in your account settings.`, HttpStatus.BAD_REQUEST, diff --git a/src/oauth/epic.service.ts b/src/oauth/epic.service.ts index 69461fc..f15725a 100644 --- a/src/oauth/epic.service.ts +++ b/src/oauth/epic.service.ts @@ -68,6 +68,7 @@ export class EpicService { user.epicAccountId = epicAccountId; user.steamProfileLink = null; + user.verified = false; const witchItResponse = ( await this._witchItService.getWitchItUserId('epic', user.epicAccountId) diff --git a/src/oauth/steam.service.ts b/src/oauth/steam.service.ts index 59a4ab5..3725811 100644 --- a/src/oauth/steam.service.ts +++ b/src/oauth/steam.service.ts @@ -66,12 +66,10 @@ export class SteamService { user.steamProfileLink = `https://steamcommunity.com/profiles/${steamId}`; user.epicAccountId = null; + user.verified = false; const witchItResponse = ( - await this._witchItService.getWitchItUserId( - 'steam', - user.steamProfileLink, - ) + await this._witchItService.getWitchItUserId('steam', steamId) ).data; if (witchItResponse.success) { user.witchItUserId = witchItResponse.witchItId; diff --git a/src/users/users.service.ts b/src/users/users.service.ts index 545d726..e9b6329 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -242,6 +242,7 @@ export class UsersService { user.steamProfileLink = null; user.witchItUserId = null; + user.verified = false; const updatedUser = await this._userRepository.save(user); @@ -261,6 +262,7 @@ export class UsersService { user.epicAccountId = null; user.witchItUserId = null; + user.verified = false; const updatedUser = await this._userRepository.save(user); diff --git a/src/witchit/witchIt.service.ts b/src/witchit/witchIt.service.ts index b9214a1..6e67771 100644 --- a/src/witchit/witchIt.service.ts +++ b/src/witchit/witchIt.service.ts @@ -75,10 +75,6 @@ export class WitchItService { platform: 'steam' | 'epic', platformIdentifier: string, ) { - if (process.env.NODE_ENV !== 'production') { - platformIdentifier = '1234'; - } - return firstValueFrom( this._httpService .get(