Skip to content

Commit

Permalink
Merge pull request #243 from TheUpperPart/Fix/#242
Browse files Browse the repository at this point in the history
Fix/#242: 채널 참여가 안되는 문제 & 관리자가 메인 화면 수정 못하는 문제 수정
  • Loading branch information
pp449 authored Nov 21, 2023
2 parents 7088716 + 1d5a4c7 commit 0e19c98
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/Modal/JoinLeague/JoinLeague.tsx
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ const JoinLeague = ({ onClose, channelLink }: JoinLeagueProps) => {
await authAPI.get(SERVER_URL + `/api/participant/stat/${gameIdVal}/${gameTagVal}`)
).data.tier;
setTier(userTier);
setGameId(gameIdVal);
setGameId(gameIdVal + '#' + gameTagVal);
};

const nicknameHandler: MouseEventHandler<HTMLElement | SVGElement> = () => {
2 changes: 1 addition & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let SERVER_URL = 'http://leaguehub.co.kr';
let SERVER_URL = 'http://leaguehub.co.kr:8080';
const SOCKET_URL = 'ws://leaguehub.co.kr/ws/websocket';

if (process.env.NODE_ENV === 'development') {
13 changes: 6 additions & 7 deletions src/pages/contents/[channelLink]/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import authAPI from '@apis/authAPI';
import HomeCard from '@components/Card/HomeCard';
import MainContentModify from '@components/Content/MainContentModify';
import Loading from '@components/Loading/Loading';
import styled from '@emotion/styled';
import useChannels from '@hooks/useChannels';
import { useQuery } from '@tanstack/react-query';
@@ -37,7 +36,7 @@ const Main = () => {
const { channelPermission } = useChannels();
const channelLink = router.query.channelLink;

const { data, isLoading, isSuccess } = useQuery<MainContent | undefined>(
const { data, isSuccess } = useQuery<MainContent | undefined>(
['getMainContents', channelLink],
() => {
return fetchData(channelLink as string);
@@ -48,14 +47,14 @@ const Main = () => {
if (isSuccess && data) setMainContents(data);
}, [isSuccess]);

if (isLoading) {
return <Loading />;
}

const handleContentUpdate = async (updatedContent: MainContent) => {
if (!channelLink) return;

const res = await authAPI({ method: 'post', url: `/api/channel/${channelLink}/main` });
const res = await authAPI({
method: 'post',
url: `/api/channel/${channelLink}/main`,
data: updatedContent,
});
if (res.status !== 200) return router.push('/');

setMainContents(updatedContent);

0 comments on commit 0e19c98

Please sign in to comment.