Skip to content

Commit

Permalink
fix: 치지직 mock 데이터에 맞게 세션 확인 api가 동작하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
i3kae committed Dec 2, 2024
1 parent 976ccff commit 583db30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/mainServer/src/streams/streams.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ export class StreamsController {
@ApiOperation({summary: 'Get Session exited', description: '방송 세션에 대한 존재 여부를 반환 받습니다.'})
async getExistence(@Query('sessionKey') sessionKey: string, @Res() res: Response) {
try {
if (this.memoryDBService.chzzkSwitch && sessionKey in this.memoryDBService.chzzkDb) {
res.status(HttpStatus.OK).json({existed: true});
return;
}
const liveSessions = this.memoryDBService.findAll().filter((info) => info.state);
if (liveSessions.some((info) => info.sessionKey === sessionKey)) {
res.status(HttpStatus.OK).json({existed: true});
Expand Down

0 comments on commit 583db30

Please sign in to comment.