Skip to content

Commit

Permalink
refactor: 핀 내 지도에 저장 기능 에러 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
GC-Park committed Sep 21, 2023
1 parent ed649ae commit ee2c8c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion frontend/src/apiHooks/usePost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ContentTypeType } from '../types/Api';

interface fetchPostProps {
url: string;
payload: {};
payload?: {} | FormData;
contentType?: ContentTypeType;
errorMessage: string;
onSuccess?: () => void;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/apis/postApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import withTokenRefresh from './utils';

export const postApi = async (
url: string,
payload: {} | FormData,
payload?: {} | FormData,
contentType?: ContentTypeType,
) => {
return await withTokenRefresh(async () => {
Expand Down
12 changes: 1 addition & 11 deletions frontend/src/components/ModalMyTopicList/addToMyTopicList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,10 @@ const AddToMyTopicList = ({ pin }: any) => {
}, []);

const addPinToTopic = async (topic: OnClickDesignatedProps) => {
const url = '/pins';
const payload = {
topicId: topic.topicId,
name: pin.name,
description: pin.description,
address: pin.address,
latitude: pin.latitude,
longitude: pin.longitude,
legalDongCode: '',
};
const url = `/topics/${topic.topicId}/copy?pinIds=${pin.id}`;

fetchPost({
url,
payload,
errorMessage:
'내 지도에 핀 추가를 실패하였습니다. 잠시 후 다시 시도해주세요.',
onSuccess: () => {
Expand Down

0 comments on commit ee2c8c3

Please sign in to comment.