diff --git a/BE-config b/BE-config index 99ed474..40a8cf0 160000 --- a/BE-config +++ b/BE-config @@ -1 +1 @@ -Subproject commit 99ed474865e242da94bf1fa23c5f5097858e49bb +Subproject commit 40a8cf06d85dea319db5a2b92c0a2f8140ceab22 diff --git a/src/channels/channels.service.ts b/src/channels/channels.service.ts index 2d1aab0..91af5eb 100644 --- a/src/channels/channels.service.ts +++ b/src/channels/channels.service.ts @@ -13,6 +13,7 @@ import { ChannelListResponseDto } from './dto/channel-list-response.dto'; import { ChannelListReturnDto } from './dto/channel-list-return.dto'; import { ChannelUsersResponseDto } from './dto/channel-users-response.dto'; import { CreateChannelRequestDto } from './dto/creat-channel-request.dto'; +import { CreateChannelResponseDto } from './dto/create-channel-response.dto'; import { CreateChannelUserParamDto } from './dto/create-channel-user-param.dto'; import { CreateInvitationParamDto } from './dto/create-invitation-param.dto'; import { DmChannelListResponseDto } from './dto/dmchannel-list-response.dto'; @@ -31,7 +32,10 @@ export class ChannelsService { private readonly logger = new Logger(ChannelsService.name); - async createChannel(userId: number, channelInfo: CreateChannelRequestDto) { + async createChannel( + userId: number, + channelInfo: CreateChannelRequestDto, + ): Promise { // DM 채널인 경우 예외 처리 if (channelInfo.channelType === ChannelType.DM) { const channelId = await this.validateDmChannel( @@ -47,8 +51,14 @@ export class ChannelsService { ); const myChannelUserType = channelUserInfoList.find( (channelUser) => channelUser.userId === userId, - )?.channelUserType; - return { channelUser: channelUserInfoList, myChannelUserType }; + )!.channelUserType; + + const createChannelResponseDto = { + channelId, + channelUsers: channelUserInfoList, + myChannelUserType, + }; + return createChannelResponseDto; } } @@ -95,10 +105,12 @@ export class ChannelsService { `channel ${channel.id} is created. user count: ${userCount}`, ); - return { - channelUser: channelUserInfoList, + const createChannelResponseDto = { + channelId: channel.id, + channelUsers: channelUserInfoList, myChannelUserType: ChannelUserType.OWNER, }; + return createChannelResponseDto; } async enterChannel(userId: number, channelId: number) { diff --git a/src/channels/dto/create-channel-response.dto.ts b/src/channels/dto/create-channel-response.dto.ts new file mode 100644 index 0000000..4d1652c --- /dev/null +++ b/src/channels/dto/create-channel-response.dto.ts @@ -0,0 +1,8 @@ +import { ChannelUserType } from 'src/common/enum'; +import { ChannelUserInfoReturnDto } from './channel-user-info-return.dto'; + +export type CreateChannelResponseDto = { + channelId: number; + channelUsers: ChannelUserInfoReturnDto[]; + myChannelUserType: ChannelUserType; +};