Skip to content

Commit

Permalink
[FIX] workspace 첫 로딩 오류
Browse files Browse the repository at this point in the history
  • Loading branch information
ara-ro committed Oct 11, 2024
1 parent 354b396 commit c6df84a
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/components/basic/CommonTopMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default {
this.fetchMyWorkspaceList();
},
methods: {
...mapActions([
...mapActions([
"setWorkspaceInfoActions",
"setWorkspaceNameInfoActions",
"setMemberInfoActions",
Expand All @@ -79,21 +79,26 @@ export default {
`${process.env.VUE_APP_API_BASE_URL}/workspace/list`
);
this.items = response.data.result; // 내 워크스페이스 목록 가져오기
if (this.items.length > 0) {
this.selectedValue = this.items[0].workspaceId; // 첫 번째 워크스페이스 ID 할당
this.emitSelected();
}
this.isLoading = true;
} catch (e) {
console.log(e);
}
},
async fetchWorkspaceInfo() {
try {
const wsInfo = await axios.get( // 워크스페이스 정보
const wsInfo = await axios.get(
// 워크스페이스 정보
`${process.env.VUE_APP_API_BASE_URL}/workspace/info/${this.selectedValue}`
);
this.setWorkspaceInfoActions(wsInfo.data.result.workspaceId);
this.setWorkspaceNameInfoActions(wsInfo.data.result.name);
const response = await axios.get( // 내 워크스페이스 회원 정보
const response = await axios.get(
// 내 워크스페이스 회원 정보
`${process.env.VUE_APP_API_BASE_URL}/member/me/workspace/${this.selectedValue}`
);
const myInfo = {
Expand All @@ -103,25 +108,24 @@ export default {
wsRole: response.data.result.wsRole,
};
this.setMemberInfoActions(myInfo);
const chInfo = await axios.get( // 채널 정보
`${process.env.VUE_APP_API_BASE_URL}/${this.selectedValue}/channel/first`
const chInfo = await axios.get(
// 채널 정보
`${process.env.VUE_APP_API_BASE_URL}/${this.selectedValue}/channel/first`
);
this.setChannelInfoActions(chInfo.data.result.channelId);
this.setChannelInfoActions(chInfo.data.result.channelId);
this.setChannelNameInfoActions(chInfo.data.result.channelName);
this.setChannelDescInfoActions(chInfo.data.result.channelInfo);
this.isLoading = true;
this.isLoading = true;
} catch (e) {
console.log(e);
}
},
async emitSelected() {
this.$emit("selected", this.selectedValue);
this.fetchWorkspaceInfo();
// window.location.reload();
// window.location.reload();
},
showWorkspaceModal() {
this.createWorkspace = true;
Expand Down

0 comments on commit c6df84a

Please sign in to comment.