diff --git a/backend/service/channel.js b/backend/service/channel.js index 07beb0a6..a2894da0 100644 --- a/backend/service/channel.js +++ b/backend/service/channel.js @@ -77,7 +77,6 @@ const inviteUserDB = async ({ channelId, workspaceUserInfoId }) => { channelId, isMute: false, notification: 0, - sectionName: null, }) channelConfig.save() }) diff --git a/backend/service/workspace.js b/backend/service/workspace.js index 00d717cc..1d7f491f 100644 --- a/backend/service/workspace.js +++ b/backend/service/workspace.js @@ -46,7 +46,6 @@ const createWorkspace = async params => { ChannelConfig.create({ channelId: ObjectId(channelData._id), workspaceUserInfoId: ObjectId(channelData.creator), - sectionName: null, }), ) await dbErrorHandler(() => diff --git a/frontend/src/atom/ChannelStarBtn/ChannelStarBtn.js b/frontend/src/atom/ChannelStarBtn/ChannelStarBtn.js index f1dbc328..c333ee85 100644 --- a/frontend/src/atom/ChannelStarBtn/ChannelStarBtn.js +++ b/frontend/src/atom/ChannelStarBtn/ChannelStarBtn.js @@ -9,6 +9,7 @@ import Icon from '../Icon' import { workspaceRecoil } from '../../store' import { STAR, COLOREDSTAR } from '../../constant/icon' import { atom, useRecoilState, useRecoilValue } from 'recoil' +import { isEmpty } from '../../util' import useChannelList from '../../hooks/useChannelList' function ChannelStarBtn({ channel }) { @@ -27,7 +28,7 @@ function ChannelStarBtn({ channel }) { const updateSection = async () => { try { let sectionName = null - if (sectionInfo === null) sectionName = 'Starred' + if (isEmpty(sectionInfo)) sectionName = 'Starred' const { data } = await request.PATCH('/api/channel/section', { workspaceUserInfoId: workspaceUserInfo._id, @@ -49,7 +50,7 @@ function ChannelStarBtn({ channel }) { return ( - {sectionInfo !== null ? ( + {!isEmpty(sectionInfo) ? ( ) : (