Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:

echo ".env 파일 생성"
echo "NEXT_PUBLIC_API_BASE_URL=${{ secrets.NEXT_PUBLIC_API_BASE_URL }}" > .env
echo "NEXT_PUBLIC_GTM_ID=${{ secrets.NEXT_PUBLIC_GTM_ID }}" >> .env
echo "NEXT_PUBLIC_KAKAO_CLIENT_ID=${{ secrets.NEXT_PUBLIC_KAKAO_CLIENT_ID }}" >> .env
echo "NEXT_PUBLIC_GOOGLE_CLIENT_ID=${{ secrets.NEXT_PUBLIC_GOOGLE_CLIENT_ID }}" >> .env

Expand Down
5 changes: 2 additions & 3 deletions src/features/study/api/get-study-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type {
DailyStudyDetail,
GetDailyStudiesParams,
GetDailyStudiesResponse,
GetDailyStudyDetailParams2,
GetMonthlyCalendarParams,
JoinStudyRequest,
MonthlyCalendarResponse,
Expand Down Expand Up @@ -87,10 +86,10 @@ export const postJoinStudy = async (payload: JoinStudyRequest) => {

// 스터디 참여 유무 확인
export const getWeeklyParticipation = async (
params: GetDailyStudyDetailParams2,
studyDate: string,
): Promise<WeeklyParticipationResponse> => {
const res = await axiosInstance.get('/study/week/participation', {
params,
params: { studyDate },
});

return res.data.content;
Expand Down
6 changes: 0 additions & 6 deletions src/features/study/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ export interface DailyStudyDetail {
feedback: string;
}

export interface GetDailyStudyDetailParams2 {
year: number;
month: number;
day: number;
}

export interface GetDailyStudiesParams {
cursor?: number;
pageSize?: number;
Expand Down
3 changes: 1 addition & 2 deletions src/features/study/model/use-study-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import {
import {
CompleteStudyRequest,
GetDailyStudiesParams,
GetDailyStudyDetailParams2,
GetMonthlyCalendarParams,
JoinStudyRequest,
MonthlyCalendarResponse,
PrepareStudyRequest,
} from '../api/types';

// 스터디 주간 참여 유무 확인 query
export const useWeeklyParticipation = (params: GetDailyStudyDetailParams2) => {
export const useWeeklyParticipation = (params: string) => {
return useQuery({
queryKey: ['weeklyParticipation', params],
queryFn: () => getWeeklyParticipation(params),
Expand Down
7 changes: 1 addition & 6 deletions src/features/study/ui/study-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,13 @@ function getWeekly(date: Date): { month: number; week: number } {

export default function StudyCard() {
const [selectedDate, setSelectedDate] = useState(new Date());
const params = {
year: selectedDate.getFullYear(),
month: selectedDate.getMonth() + 1,
day: selectedDate.getDate(),
};

const offset = selectedDate.getTimezoneOffset() * 60000; // ms단위라 60000곱해줌
const dateOffset = new Date(selectedDate.getTime() - offset);

const studyDate = dateOffset.toISOString().split('T')[0];

const { data: participationData } = useWeeklyParticipation(params);
const { data: participationData } = useWeeklyParticipation(studyDate);
const isParticipate = participationData?.isParticipate ?? false;

const { month, week } = getWeekly(selectedDate);
Expand Down