Skip to content

Commit

Permalink
๐Ÿ› develop branch ๊ฐ„์˜ ์ถฉ๋Œ ์ด์Šˆ ํ•ด๊ฒฐ
Browse files Browse the repository at this point in the history
  • Loading branch information
RookieAND committed Feb 29, 2024
1 parent e80a80a commit 81d2829
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 2 additions & 3 deletions src/apis/course/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@ export const CourseRepository = {
},

async postSaveCourseAsync({
userId,
courseName,
}: CourseRequestParamType['postSaveCourse']) {
return postAsync<
const response = await postAsync<
ApiResponseType<CourseResponseType['postSaveCourse']>,
CourseRequestParamType['postSaveCourse']
>('/v1/courses', {
userId,
courseName,
});
return response.data;
},

async deleteCourseAsync({
Expand Down
6 changes: 3 additions & 3 deletions src/pages/main/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { useModal } from '@/hooks/useModal';
import { useTmap } from '@/hooks/useTmap';
import { usePostSaveCourse } from '@/query-hooks/course/mutation';
import { useGetUserInformation } from '@/query-hooks/user/query';
import { COLOR } from '@/styles/foundation';
import { CourseTabType } from '@/types';

import * as S from './MainPage.css';
import { COLOR } from '@/styles/foundation';

const MainPage = () => {
const { mapContainerRef } = useTmap();
Expand All @@ -37,8 +37,8 @@ const MainPage = () => {

const handleMakeNewCourse = async () => {
openModal(<MakeNewCourseModal />);
const response = await makeNewCourse('์ƒˆ๋กœ์šด ์ฝ”์Šค');
navigate(`/course/${response.data.courseId}`);
const { courseId } = await makeNewCourse('์ƒˆ๋กœ์šด ์ฝ”์Šค');
navigate(`/course/${courseId}`);
};

return (
Expand Down
7 changes: 5 additions & 2 deletions src/utils/tmap/TmapModuleProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ export const TmapProvider = ({
return () => {
tmapModuleRef.current = null;
};
}, [height, lat, lng, mapId, width, zoom, pathname]);
}, [height, lat, lng, mapId, width, zoom]);

return (
<TmapContext.Provider value={{ mapContainerRef, tmapModuleRef }}>
<TmapContext.Provider
value={{ mapContainerRef, tmapModuleRef }}
key={pathname}
>
{children}
</TmapContext.Provider>
);
Expand Down

0 comments on commit 81d2829

Please sign in to comment.