diff --git a/src/plugins/twitch/services/twitch.service.spec.ts b/src/plugins/twitch/services/twitch.service.spec.ts index e05726e2d..dafeab1f2 100644 --- a/src/plugins/twitch/services/twitch.service.spec.ts +++ b/src/plugins/twitch/services/twitch.service.spec.ts @@ -244,7 +244,7 @@ describe('TwitchService', () => { // @ts-expect-error player = await playersService._createOne(); await twitchTvProfileModel.create({ - player: player.id, + player: player._id, userId: '44322889', login: 'dallas', displayName: 'dallas', @@ -254,7 +254,7 @@ describe('TwitchService', () => { }); it('should return the deleted twitch.tv profile', async () => { - const profile = await service.deleteUserProfile(player.id); + const profile = await service.deleteUserProfile(`${player.id}`); expect(profile.player).toEqual(player.id); }); diff --git a/src/plugins/twitch/services/twitch.service.ts b/src/plugins/twitch/services/twitch.service.ts index 03d40a906..5e07c497a 100644 --- a/src/plugins/twitch/services/twitch.service.ts +++ b/src/plugins/twitch/services/twitch.service.ts @@ -130,7 +130,7 @@ export class TwitchService implements OnModuleInit { const ret = plainToClass( TwitchTvProfile, await this.twitchTvProfileModel - .findOneAndDelete({ player: playerId }) + .findOneAndDelete({ player: new ObjectId(playerId) }) .orFail() .lean() .exec(),