Skip to content

Commit 628ad0f

Browse files
Merge pull request #461 from BinaryStudioAcademy/task/OV-00-add-logs
OV-00: + logs
2 parents 72e6590 + 1f234fb commit 628ad0f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

backend/src/bundles/public-video/public-video.service.ts

+15-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,21 @@ class PublicVideoService {
1010
this.videoRepository = videoRepository;
1111
}
1212

13-
public async findUrlByToken(token: string): Promise<string> {
14-
const id = await tokenService.getIdFromToken(token);
13+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
14+
public async findUrlByToken(token: any): Promise<string> {
15+
let id;
16+
17+
// eslint-disable-next-line no-console
18+
console.log(token, 'find url by token');
19+
if (token.id) {
20+
id = token.id;
21+
// eslint-disable-next-line no-console
22+
console.log('id from token', id);
23+
} else {
24+
id = await tokenService.getIdFromToken(token);
25+
// eslint-disable-next-line no-console
26+
console.log('id from else', id);
27+
}
1528

1629
if (!id) {
1730
this.throwVideoNotFoundError();

0 commit comments

Comments
 (0)