Skip to content

Commit

Permalink
fix: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GiyoMoon committed Aug 26, 2024
1 parent b749a8e commit c24d548
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/inventory/inventory.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/oauth/epic.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions src/oauth/steam.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export class UsersService {

user.steamProfileLink = null;
user.witchItUserId = null;
user.verified = false;

const updatedUser = await this._userRepository.save(user);

Expand All @@ -261,6 +262,7 @@ export class UsersService {

user.epicAccountId = null;
user.witchItUserId = null;
user.verified = false;

const updatedUser = await this._userRepository.save(user);

Expand Down
4 changes: 0 additions & 4 deletions src/witchit/witchIt.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<UserLookup>(
Expand Down

0 comments on commit c24d548

Please sign in to comment.