Skip to content

Commit

Permalink
[fix] StreamKey 감추기, 오타 수정 (#140)
Browse files Browse the repository at this point in the history
* fix: StreamKey 감추기, 오타 수정

* fix: StreamKey 감추기

* style: 코드 포맷팅 적용

* style: eslint rule 추가 - no-unused-vars
  • Loading branch information
kkg5 authored Dec 5, 2023
1 parent 4111306 commit eafd67b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
4 changes: 4 additions & 0 deletions server/api-server/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ module.exports = {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true },
],
'linebreak-style': ['error', 'unix'],
},
};
2 changes: 1 addition & 1 deletion server/api-server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function bootstrap() {
await redisIoAdapter.connectToRedis();
app.useWebSocketAdapter(redisIoAdapter);

if (process.env.NOD_ENV === 'production') {
if (process.env.NODE_ENV === 'production') {
await app.init();
http.createServer(server).listen(3000);
}
Expand Down
22 changes: 14 additions & 8 deletions server/api-server/src/streams/streams.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ export class StreamsService {
});

return {
data: users.map((user) => ({
userId: user.userId,
title: user.stream.title,
category: user.stream.category,
...videoInfos.find((info) => info.streamKey === user.stream.streamKey),
viewer: this.chatGateway.getViewers(user.userId),
})),
data: users.map((user) => {
const { streamKey, ...videoInfo } = videoInfos.find(
(info) => info.streamKey === user.stream.streamKey,
);

return {
userId: user.userId,
title: user.stream.title,
category: user.stream.category,
...videoInfo,
viewer: this.chatGateway.getViewers(user.userId),
};
}),
pageInfo: {
page,
size,
Expand All @@ -59,7 +65,7 @@ export class StreamsService {
}

const videoInfos = await this.videoInfoProvider.getVideoInfo();
const videoInfo = videoInfos.find(
const { streamKey, ...videoInfo } = videoInfos.find(
(info) => info.streamKey === user.stream.streamKey,
);

Expand Down

0 comments on commit eafd67b

Please sign in to comment.