Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: fix react query #285

Merged
merged 9 commits into from
Jan 28, 2024
Merged

Fix: fix react query #285

merged 9 commits into from
Jan 28, 2024

Conversation

JSH99
Copy link
Member

@JSH99 JSH99 commented Jan 28, 2024

개요

스크린샷

주요 내용

  • 장소 검색에서 일정 추가하기 hook

고민한 점, 질문거리

@Yamyam-code 상원님!

addPlaces 함수 업데이트

/pages/AddPlaceFromVote.tsx

const setSelectedTabIndex = useSetRecoilState(activeTabIndexState);

const addPlaces = async () => {
    await postPlaces.mutateAsync({
      spaceId: Number(id),
      journeyId: Number(journeyId),
      placeIds: selectedPlaces.flatMap((place) => place.id),
    });
    navigate(`/trip/${id}`, {state: {id: id}});
    setSelectedTabIndex(1);
};

addSearchPlaces 함수 (장소 검색에서 일정 추가하기)

image
const postSearchPlaces = usePostSearchPlaces();

const addSearchPlaces = async () => {
    await postSearchPlaces.mutateAsync({
      spaceId: id,
      journeyId: journeyId,
      places: places,
    });
    navigate(`/trip/${id}`, {state: {id: id}});
    setSelectedTabIndex(1);
  };

api, hook 참고는 각각 api/spaces.ts, hooks/Spaces/space.ts 에서 확인해주시면 됩니다! 마지막까지 감사합니다 🙇🏻‍♀️

@JSH99 JSH99 self-assigned this Jan 28, 2024
@JSH99 JSH99 linked an issue Jan 28, 2024 that may be closed by this pull request
1 task
Copy link

vercel bot commented Jan 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
trip-vote-fe ✅ Ready (Inspect) Visit Preview Jan 28, 2024 8:09pm

@JSH99 JSH99 merged commit 670359c into dev Jan 28, 2024
3 checks passed
@JSH99 JSH99 deleted the 270-fix-fix-react-query branch January 28, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix : fix react query
3 participants