Skip to content

Commit

Permalink
Merge pull request #461 from BinaryStudioAcademy/task/OV-00-add-logs
Browse files Browse the repository at this point in the history
OV-00: + logs
  • Loading branch information
nikita-remeslov authored Sep 28, 2024
2 parents 72e6590 + 1f234fb commit 628ad0f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions backend/src/bundles/public-video/public-video.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,21 @@ class PublicVideoService {
this.videoRepository = videoRepository;
}

public async findUrlByToken(token: string): Promise<string> {
const id = await tokenService.getIdFromToken(token);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public async findUrlByToken(token: any): Promise<string> {
let id;

// eslint-disable-next-line no-console
console.log(token, 'find url by token');
if (token.id) {
id = token.id;
// eslint-disable-next-line no-console
console.log('id from token', id);
} else {
id = await tokenService.getIdFromToken(token);
// eslint-disable-next-line no-console
console.log('id from else', id);
}

if (!id) {
this.throwVideoNotFoundError();
Expand Down

0 comments on commit 628ad0f

Please sign in to comment.