Skip to content

Commit

Permalink
Merge pull request #19 from Team-B1ND/hotfix/#18
Browse files Browse the repository at this point in the history
hotfix :: shedule load api params change #18
  • Loading branch information
s1hyun2 authored Sep 27, 2024
2 parents ddfe638 + 7cafa66 commit 8e43c09
Show file tree
Hide file tree
Showing 8 changed files with 20,421 additions and 32,898 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
53,274 changes: 20,404 additions & 32,870 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dependencies": {
"@b1nd/b1nd-styled-components-util": "^1.0.1",
"@react-icons/all-files": "^4.1.0",
"@team-b1nd/dodamdodam_web_component_library": "^1.2.2",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.3.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/schedule/useCalendarSchedules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const useCalendarSchedules = () => {
const { data: memberData } = useGetMember();

const { data: schedulesData, isLoading } = useGetSchedulesByDate({
startDate: date,
endDate: `${date.slice(0, 8)}${dayjs(date).daysInMonth()}`,
startAt: date,
endAt: `${date.slice(0, 8)}${dayjs(date).daysInMonth()}`,
});

const loadCalendarSchedule = useCallback(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/schedule/useHomeSidebarSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const useHomeSidebarSchedule = () => {
const { data: memberData } = useGetMember();
const { data: schedulesData } = useGetSchedulesByDate(
{
startDate: date,
endDate: `${date.slice(0, 8)}${dayjs(date).daysInMonth()}`,
startAt: date,
endAt: `${date.slice(0, 8)}${dayjs(date).daysInMonth()}`,
},
{ suspense: true },
);
Expand Down
8 changes: 4 additions & 4 deletions src/queries/schedule/schedule.query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const useGetSchedules = ({
);

export const useGetSchedulesByDate = (
{ startDate, endDate }: getSchedulesByDateParam,
{ startAt, endAt }: getSchedulesByDateParam,
options?: UseQueryOptions<
SchduelsByDateResponse,
AxiosError,
Expand All @@ -33,10 +33,10 @@ export const useGetSchedulesByDate = (
>
): UseQueryResult<SchduelsByDateResponse, AxiosError> =>
useQuery(
["schedule/getSchedulesByDate", `${startDate}~${endDate}`],
() => scheduleRepository.getSchedulesByDate({ startDate, endDate }),
["schedule/getSchedulesByDate", `${startAt}~${endAt}`],
() => scheduleRepository.getSchedulesByDate({ startAt, endAt }),
{
enabled: !!startDate && !!endDate,
enabled: !!startAt && !!endAt,
...options,
staleTime: 1000 * 60,
cacheTime: 1000 * 60 * 60,
Expand Down
4 changes: 2 additions & 2 deletions src/repository/schedule/schedule.param.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export interface getSchedulesParam {
}

export interface getSchedulesByDateParam {
startDate: string;
endDate: string;
startAt: string;
endAt: string;
}
23 changes: 5 additions & 18 deletions src/repository/schedule/schedule.repository.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
import { dodamV6Axios } from "../../lib/axios/customAxios";
import {
SchduelsByDateResponse,
SchedulesResponse,
} from "../../types/schedule/schedule.type";
import { SchduelsByDateResponse, SchedulesResponse } from "../../types/schedule/schedule.type";
import { getSchedulesByDateParam, getSchedulesParam } from "./schedule.param";

class ScheduleRepository {
public async getSchedules({
page,
limit,
}: getSchedulesParam): Promise<SchedulesResponse> {
const { data } = await dodamV6Axios.get(
`/schedule?limit=${limit}&page=${page}`
);
public async getSchedules({ page, limit }: getSchedulesParam): Promise<SchedulesResponse> {
const { data } = await dodamV6Axios.get(`/schedule?limit=${limit}&page=${page}`);
return data;
}

public async getSchedulesByDate({
startDate,
endDate,
}: getSchedulesByDateParam): Promise<SchduelsByDateResponse> {
const { data } = await dodamV6Axios.get(
`/schedule/search?startDate=${startDate}&endDate=${endDate}`
);
public async getSchedulesByDate({ startAt, endAt }: getSchedulesByDateParam): Promise<SchduelsByDateResponse> {
const { data } = await dodamV6Axios.get(`/schedule/search?startAt=${startAt}&endAt=${endAt}`);
return data;
}
}
Expand Down

0 comments on commit 8e43c09

Please sign in to comment.