Skip to content

Commit

Permalink
fix: private study (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungJL authored May 6, 2024
2 parents e2dd1c8 + 7ca5161 commit 418fb4a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pages/study/[id]/[date]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useParams } from "next/navigation";
import { useSession } from "next-auth/react";
import { useParams } from "next/navigation";
import { useEffect } from "react";
import { useRecoilState, useSetRecoilState } from "recoil";
import styled from "styled-components";

import Divider from "../../../../components/atoms/Divider";
import Slide from "../../../../components/layouts/PageSlide";
import { PLACE_TO_LOCATION } from "../../../../constants/serviceConstants/studyConstants/studyLocationConstants";
import { ALL_스터디인증 } from "../../../../constants/serviceConstants/studyConstants/studyPlaceConstants";
import { useStudyVoteQuery } from "../../../../hooks/study/queries";
import { getStudyDateStatus } from "../../../../libs/study/date/getStudyDateStatus";
import { getMyStudy } from "../../../../libs/study/getMyStudy";
Expand All @@ -26,9 +27,10 @@ export default function Page() {
const setMyStudy = useSetRecoilState(myStudyState);

const location = PLACE_TO_LOCATION[id];
console.log(location);
const isPrivateStudy = id === ALL_스터디인증;

const { data: studyAll } = useStudyVoteQuery(date, location, {
enabled: !!location && !!date,
enabled: (!!location || isPrivateStudy) && !!date,
});

const [studyDateStatus, setStudyDateStatus] = useRecoilState(studyDateStatusState);
Expand All @@ -50,7 +52,6 @@ export default function Page() {
studyDateStatus !== "not passed"
? study?.attendences.filter((att) => att.firstChoice)
: study?.attendences;
const isPrivateStudy = place?.brand === "자유 신청";

return (
<Layout>
Expand Down

0 comments on commit 418fb4a

Please sign in to comment.