diff --git a/server/api-server/.eslintrc.js b/server/api-server/.eslintrc.js index e32eea7..8c62677 100644 --- a/server/api-server/.eslintrc.js +++ b/server/api-server/.eslintrc.js @@ -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'], }, }; diff --git a/server/api-server/src/main.ts b/server/api-server/src/main.ts index 51ef4ff..3ac2fe6 100644 --- a/server/api-server/src/main.ts +++ b/server/api-server/src/main.ts @@ -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); } diff --git a/server/api-server/src/streams/streams.service.ts b/server/api-server/src/streams/streams.service.ts index 03ca39d..f448066 100644 --- a/server/api-server/src/streams/streams.service.ts +++ b/server/api-server/src/streams/streams.service.ts @@ -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, @@ -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, );