Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
98f8b94
🔨 fix: formProvider에서 onSubmit에 void 함수 추가
Sangjun-man Sep 16, 2023
d002277
🔨 fix: 봉사자 회원가입 이후 바로 로그인 되도록 수정
Sangjun-man Sep 16, 2023
2c27b54
Merge pull request #2 from DangleDangle/fix/register_next
Sangjun-man Sep 16, 2023
86d4cfd
✨ feat: 회원 가입시 다음 입력창 focus하도록 추가
Sangjun-man Sep 16, 2023
4afaad6
Merge pull request #3 from DangleDangle/fix/register_focus
Sangjun-man Sep 17, 2023
b704899
🔨 fix: api handler에서 400 error 전달하도록 fix
Paperkeem Sep 18, 2023
88ddb4d
🚀 update: 보호소 로그인 페이지 댕글댕글 영문표기 한글로 변경
Paperkeem Sep 18, 2023
b4c9288
[Fix] 보호소 login alert 표출
Paperkeem Sep 18, 2023
926cfba
🔨 fix: 홈 캘린더 이벤트 dot 인디케이터 추가
hayoiii Sep 21, 2023
fb00763
🔨 fix: 개인봉사자 회원가입 에러 문구
hayoiii Sep 21, 2023
4fea22d
🔨 fix: 가입 완료 이미지 해상도 4x로 변경, 오타 수정
hayoiii Sep 21, 2023
a7777cc
🔨 fix: Carousel - SENSITIVITY, WHEEL_SPEED 조정, 터치 중에 y축 스크롤 방지
hayoiii Sep 21, 2023
4ac9b12
🔨 fix: 오타 수정
hayoiii Sep 21, 2023
3247b0c
🚀 update: metadata 도메인 업데이트
Paperkeem Sep 21, 2023
9198355
🔨 fix: 글자수 0/10 노출 오류
Paperkeem Sep 22, 2023
59153f0
🔨 fix: 상세 주소 page adress, postalCode input readonly
Paperkeem Sep 22, 2023
9466083
🚀 update: 이용약관 연결
Paperkeem Sep 22, 2023
deb9187
🔨 fix: 보호소 홈에서 즐겨찾기 해제 시 북마크 list 반영 안되는 이슈 fix
Paperkeem Sep 23, 2023
5604e58
🚀 update: header zIdex 조정
Paperkeem Sep 23, 2023
8c41483
🚀 update: 보호소 회원가입 step 에서 새로고침 시 /register/shelter로 이동하도록 로직 수정
Paperkeem Sep 23, 2023
da815ca
[Fix] shelter login/register QA
Paperkeem Sep 23, 2023
8a6c959
🚀 update: 비밀번호 메일 전송 api 연결
Paperkeem Oct 5, 2023
07eed34
🚀 update: 변경된 비밀번호 일 경우 로그인 시 비밀번호 변경 페이지로 routing
Paperkeem Oct 5, 2023
c3fd1da
🔨 fix: 개인봉사자, 보호소 파트너 클릭시에도 어드민 페이지 이동하도록 수정
Sangjun-man Oct 1, 2023
359a45c
🔨 fix: 메인페이지 헤더 색상변경 수정
Sangjun-man Oct 1, 2023
e1b3183
✨ feat: 모바일 사파리 환경에서 노치부분 색상 변경 코드 추가
Sangjun-man Oct 5, 2023
8487009
🔨 fix: 다가오는 이벤트 카드 클릭가능 영역 수정
Sangjun-man Oct 5, 2023
8a2ab19
🚚 chore: faq, 개인정보 처리방침 링크 연동
Sangjun-man Oct 5, 2023
2c8d857
Merge pull request #7 from DangleDangle/fix/qa
Sangjun-man Oct 5, 2023
3b327de
🔨 fix: 웹페이지 처음 방문 환경에서 header 뒤로가기 클릭 시 home으로 라우팅
Paperkeem Oct 6, 2023
ab115ea
💄 style: 캘린더 영역 내 UI 폰트 사이즈 \& meta data viewport
Paperkeem Oct 6, 2023
26a8721
✨ feat: 비밀번호 변경 api 연결
Paperkeem Oct 6, 2023
cd3c456
🔨 fix: 봉사 생성/수정/삭제/신청/철회 시 query 데이터 refetch 되도록 수정
Paperkeem Oct 6, 2023
72f4756
Merge remote-tracking branch 'origin/qa' into feat/YW2-235_pwd_reset
Paperkeem Oct 6, 2023
b4d1298
[Feat] YW2-235_pwd_reset
Paperkeem Oct 6, 2023
43b8f23
🔨 fix: 홈캘린더 Filter - pickOption 초기화 로직, 모달에서 스크롤 방지
hayoiii Oct 7, 2023
84dc747
✨ feat: useLocalStorage - 로컬 스토리지에서 특정 키에 대한 CRUD
hayoiii Oct 8, 2023
09942b8
✨ feat: 홈 캘린더 - useLocalStorage로 이전 필터값 유지
hayoiii Oct 8, 2023
e9ca357
✨ feat: 로그아웃 시 캘린더 필터 로컬 스토리지 제거
hayoiii Oct 8, 2023
a4b7bcf
🔨 fix: 홈 캘린더 필터 로컬 스토리지 초기화
hayoiii Oct 8, 2023
69572ec
🚀 update: 특별동물 리스트 조회에 useObservationAnimalListAtHome만 사용, queryKey에 …
hayoiii Oct 8, 2023
5943828
🔨 fix: Avartar 이미지 비율 깨짐
hayoiii Oct 8, 2023
3767d17
🚀 update: 보호소 추가정보 status - '입력중' 추가
hayoiii Oct 8, 2023
2ab4929
🔨 fix: text color 기본값 우선순위 낮게 변경
hayoiii Oct 8, 2023
60681e8
🔨 fix: 일정 시간 정보 표출 오류 fix
Paperkeem Oct 10, 2023
e0b9917
🚀 update: 비밀번호 변경 완료 시 로그아웃 처리
Paperkeem Oct 10, 2023
e4c480f
🚀 update: 카카오 알림 상태 변경 시 토스트 메세지 문구 수정
Paperkeem Oct 10, 2023
ac01012
🚀 update: 문의하기 선택 시 오피셜 이메일 계정으로 이메일 작성
Paperkeem Oct 10, 2023
086bd51
🔨 fix: 푸터 간격 올바르도록 수정
Sangjun-man Oct 10, 2023
76b6744
🔨 fix: 일정 소개 글자수 정보 표기하도록 수정
Sangjun-man Oct 10, 2023
bc32b9f
🔨 fix: 메인 헤더에서 마이페이지 이동 클릭 범위수정
Sangjun-man Oct 10, 2023
8a9c5b9
🚀 update: 개인봉사자 계정관리 수정 완료 시 history stack에서 제외
Paperkeem Oct 10, 2023
24ac76d
🔨 fix: 봉사 일정 생성 하단 패딩 추가
Sangjun-man Oct 10, 2023
b6a1b48
[FIX] Extra QA
Paperkeem Oct 10, 2023
50c0fe2
🔨 fix: 추가 정보 수정 화면에서 저장하기 활성화버튼 로직 수정
Sangjun-man Oct 10, 2023
d5371e8
Merge branch 'qa' of github.com:DangleDangle/dangledangle-client into qa
hayoiii Oct 11, 2023
af752f9
Merge pull request #10 from DangleDangle/fix/qa_sj
Sangjun-man Oct 11, 2023
380623d
✨ feat: 특별케어동물 폼 저장 안하고 나갈 시 다이얼로그
hayoiii Oct 12, 2023
a8767fa
🚀 update: 보호소 추가 정보 입력 폼 - 변경된 필드가 있을 경우에만 submittable
hayoiii Oct 12, 2023
337b9ba
✨ feat: useRouteGuard - 브라우저 뒤로가기, 새로고침 방지 (form 페이지에서 사용)
hayoiii Oct 12, 2023
29f9711
✨ feat: 보호소 추가정보 폼 - 저장없이 나가기 방지
hayoiii Oct 12, 2023
5785707
✨ feat: 보호소 필수 정보 입력 폼 - 수정했을 때만 submittable, 저장없이 나가기 방지
hayoiii Oct 12, 2023
600e70a
Merge branch 'qa' of github.com:DangleDangle/dangledangle-client into qa
hayoiii Oct 12, 2023
abf98aa
🔨 fix: refresh token endpoint
hayoiii Oct 12, 2023
b73d637
✨ feat: 일정 생성 - 시작 시간 설정 시 종료 시간 default 값 설정
hayoiii Oct 12, 2023
8bbf8fc
🚀 update: 일정 생성 - useRouteGuard 적용
hayoiii Oct 12, 2023
4c89e8f
🔨 fix: useRouteGuard - 로직 오류 수정
hayoiii Oct 12, 2023
e99057c
✨ feat: 일정 생성 - 반복 주기 종료일 default 값을 startAt의 endOfMonth로 설정, useRout…
hayoiii Oct 12, 2023
845c8b9
🔨 fix: 보호소 정보 수정 - 저장 시 router.replace
hayoiii Oct 12, 2023
1b895b6
🔨 fix: 보호소 정보 수정사항 ShelterProfile ui에 반영
hayoiii Oct 12, 2023
fac0b76
🔨 fix: fix: 보호소 정보 수정 - 저장 시 router.replace
hayoiii Oct 12, 2023
82fc626
🔨 fix: 보호소 홈 캘린더 sticky 적용 안되는 문제
hayoiii Oct 13, 2023
f187120
🔨 fix: calendar css - layout, font, 여백 수정
hayoiii Oct 13, 2023
fc5b26b
🚀 update: calendar footer prop 추가
hayoiii Oct 13, 2023
56c33f3
🚀 update: 홈 캘린더 - 열고 닫을 때 transition 추가
hayoiii Oct 13, 2023
ef4d5cc
🔨 fix: 특별동물 불러오기 infiniteQuery 적용
Sangjun-man Oct 13, 2023
d7c8417
🔨 fix: footer keyprop 에러 수정
Sangjun-man Oct 13, 2023
eb8ceaa
🔨 fix: 회원가입시 input 태그에 focus하도록 수정
Sangjun-man Oct 13, 2023
3b2edaa
🔨 fix: 클라이언트 사이드 라우팅에서도 safari 헤더부분 색상 변경되도록 수정
Sangjun-man Oct 14, 2023
35edd9f
🚚 chore: exceptionCode 업데이트
Sangjun-man Oct 14, 2023
55c3c8f
🚀 update: 유효하지 않은 토큰 에러일 시 강제 logout하는 기능 구현
Sangjun-man Oct 14, 2023
6712b59
Merge pull request #11 from DangleDangle/fix/qa-sj
Sangjun-man Oct 15, 2023
c888093
🚀 update: 비밀번호 찾기 토스트 메세지 변경 \& input autoFocus 처리
Paperkeem Oct 16, 2023
4b872a0
🔨 fix: 이미지 업로드 시 로딩, 에러 ui
hayoiii Oct 16, 2023
e0deebe
🔨 fix: 보호소 이미지 업로더 error ui
hayoiii Oct 16, 2023
d1e5480
🔨 fix: 홈 캘린더 overflow-x 숨기기
hayoiii Oct 16, 2023
b6c7673
🔨 fix: 다가오는 일정 카드 폰트 색상 잘못 보여주던것 수정
Sangjun-man Oct 18, 2023
9f2ad20
✨ feat: breakLine util 함수 - \n을 \<br/\>로 대치
hayoiii Oct 19, 2023
810fbc7
Merge branch 'qa' of github.com:DangleDangle/dangledangle-client into qa
hayoiii Oct 19, 2023
f2af14a
🔨 fix: 강제 로그아웃 path 확인하는 미들웨어 수정
Sangjun-man Oct 19, 2023
93f1fa3
🔨 fix: textarea에 세로 스크롤 하나만 생기도록 수정
Sangjun-man Oct 19, 2023
6698b77
🔨 fix: 봉사 생성 시 endAt이 월의 마지막 일일 때 처리
hayoiii Oct 22, 2023
2681239
🚀 update: 봉사 일정 날짜 input의 max값 설정
hayoiii Oct 22, 2023
2ac1b2a
🔨 fix: 일정 생성 완료 시 라우팅
hayoiii Oct 22, 2023
a5dbe6e
🔨 fix: 보호소 정보 query hook으로 최신 데이터 업데이트
hayoiii Oct 22, 2023
f3ce721
🚀 update: 카카오 공유하기 objectType 변경
Paperkeem Oct 23, 2023
500fccc
🚀 update: remove metadataBase
Paperkeem Jan 28, 2024
e5f0772
🤖 refactor: dynamic Metadata
Paperkeem Mar 5, 2024
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
Binary file removed public/images/Particle.png
Binary file not shown.
Binary file modified public/images/ParticleWithLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions public/svg/SnsShareImg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/api/auth/volunteer/refresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const fetchRefresh = async (data: LoginResponse) => {
};

export const getRefresh = async () => {
const response = await fe.get(`auth/token/refresh`).then(res =>
const response = await fe.get(`auth/token`).then(res =>
res.json<{
success: boolean;
}>()
Expand Down
4 changes: 3 additions & 1 deletion src/api/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { setAuthorizationHeader } from '@/utils/ky/hooks/beforeRequest';
import {
deleteClientCokiesPath,
retryRequestOnUnauthorized,
throwServerErrorMessage
throwServerErrorMessage,
redirectTokenError
} from '@/utils/ky/hooks/afterResponse';

/**
Expand All @@ -26,6 +27,7 @@ const api = ky.extend({
beforeRequest: [setAuthorizationHeader(process)],
afterResponse: [
retryRequestOnUnauthorized(process),
redirectTokenError(process),
throwServerErrorMessage,
deleteClientCokiesPath
]
Expand Down
2 changes: 2 additions & 0 deletions src/api/mypage/useLogout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { useAuthContext } from '@/providers/AuthContext';
import { useMutation } from '@tanstack/react-query';
import useToast from '@/hooks/useToast';
import { fe } from '../instance';
import { STORAGE_KEY_HOME_CALENDAR_FILTER_INPUT } from '@/constants/localStorageKeys';

export default function useLogout() {
const { logout: clientLogout } = useAuthContext();
Expand All @@ -18,6 +19,7 @@ export default function useLogout() {
onSuccess: response => {
clientLogout();
location.href = '/login';
localStorage.removeItem(STORAGE_KEY_HOME_CALENDAR_FILTER_INPUT);
toastOn('로그아웃이 완료되었습니다.');
},
onError: error => {
Expand Down
11 changes: 6 additions & 5 deletions src/api/queryKey.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export const shelterKey = {
all: ['shelter'] as const,
animalList: () => [...shelterKey.all, 'observation-animal-list'] as const,
animal: (id: number) => [...shelterKey.animalList(), id] as const,
image: () => [...shelterKey.all, 'image'] as const,
animalLists: () => [...shelterKey.all, 'observation-animal-list'] as const,
animalList: (shelterId: number) =>
[...shelterKey.animalLists(), shelterId] as const,
animal: (id: number) => [...shelterKey.animalLists(), 'animal', id] as const,
info: () => [...shelterKey.all, 'info'] as const,
homeInfo: () => [...shelterKey.all, 'info', 'home'] as const,
observationAnimal: () => [...shelterKey.all, 'observation-animal'] as const
image: () => [...shelterKey.info(), 'image'] as const,
homeInfo: () => [...shelterKey.info(), 'home'] as const
};
7 changes: 0 additions & 7 deletions src/api/shelter/admin/observation-animal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ export const get = async (observationAnimalId: number) => {
return response;
};

export const getAll = async () => {
const response = await api
.get('shelter/admin/observation-animal')
.then(res => res.json<ObservationAnimal[]>());
return response;
};

export const post = async (data: ObservationAnimalPayload) => {
const response = await api
.post(`shelter/admin/observation-animal`, {
Expand Down
2 changes: 1 addition & 1 deletion src/api/shelter/admin/useCreateObservationAnimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function useCreateObservationAnimal(
{
onSuccess: (data, variables, context) => {
options?.onSuccess && options.onSuccess(data, variables, context);
return queryClient.invalidateQueries(shelterKey.animalList());
return queryClient.invalidateQueries(shelterKey.animalLists());
},
...options
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/shelter/admin/useDeleteObservationAnimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function useDeleteObservationAnimal(
{
onSuccess: (data, variables, context) => {
options?.onSuccess && options.onSuccess(data, variables, context);
return queryClient.invalidateQueries(shelterKey.animalList());
return queryClient.invalidateQueries(shelterKey.animalLists());
},
...options
}
Expand Down
1 change: 0 additions & 1 deletion src/api/shelter/admin/useDeleteVolunteerEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
useQueryClient
} from '@tanstack/react-query';
import { DeleteResponse, remove } from './volunteer-event';
import { queryKey } from '../volunteer-event';

export interface DeleteEventPayload extends DeleteResponse {
shelterId: number;
Expand Down
16 changes: 0 additions & 16 deletions src/api/shelter/admin/useObservationAnimalList.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/shelter/admin/useUpdateEssentialInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function useUpdateEssentialInfo(
{
onSuccess: (data, variables, context) => {
options?.onSuccess && options.onSuccess(data, variables, context);
return queryClient.invalidateQueries(shelterKey.info());
queryClient.invalidateQueries(shelterKey.info());
},
...options
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/shelter/admin/useUpdateObservationAnimal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function useUpdateObservationAnimal(
{
onSuccess: (data, variables, context) => {
options?.onSuccess && options.onSuccess(data, variables, context);
return queryClient.invalidateQueries(shelterKey.animalList());
return queryClient.invalidateQueries(shelterKey.animalLists());
},
...options
}
Expand Down
26 changes: 26 additions & 0 deletions src/api/shelter/admin/useUpdateVolunteerEvent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import {
UseMutationOptions,
useMutation,
useQueryClient
} from '@tanstack/react-query';
import { PutResponse, PutVolunteerEventPayload, put } from './volunteer-event';

export interface PutEventPayload extends PutVolunteerEventPayload {
eventId: number;
}

export default function useUpdateVolunteerEvent(
options?: UseMutationOptions<PutResponse, unknown, PutEventPayload>
) {
const queryClient = useQueryClient();
return useMutation<PutResponse, unknown, PutEventPayload>(
({ eventId, ...payload }) => put(eventId, payload),
{
onSuccess: (data, variables, context) => {
options?.onSuccess && options.onSuccess(data, variables, context);
return queryClient.invalidateQueries();
},
...options
}
);
}
22 changes: 22 additions & 0 deletions src/api/shelter/admin/useWriteVolunteerEvent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {
UseMutationOptions,
useMutation,
useQueryClient
} from '@tanstack/react-query';
import { PostResponse, VolunteerEventPayload, post } from './volunteer-event';

export default function useWriteVolunteerEvent(
options?: UseMutationOptions<PostResponse, unknown, VolunteerEventPayload>
) {
const queryClient = useQueryClient();
return useMutation<PostResponse, unknown, VolunteerEventPayload>(
payload => post(payload),
{
onSuccess: (data, variables, context) => {
options?.onSuccess && options.onSuccess(data, variables, context);
return queryClient.invalidateQueries();
},
...options
}
);
}
38 changes: 38 additions & 0 deletions src/api/shelter/auth/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,26 @@ export interface LoginPayload {
export type LoginResponse = {
accessToken: string;
refreshToken: string;
needToChangePassword: boolean;
};
export interface FowardPwdPayload {
email: string;
phoneNumber: string;
}

export type FowardPwdResponse = {
shelterUserId: number;
needToChangePassword: boolean;
};

export interface PwdChangePayload {
password: string;
}
export interface PwdChangeResponse {
shelterUserId: number;
needToChangePassword: boolean;
}

export const loginShelter = async (data: LoginPayload) => {
const response = await api
.post(`auth/shelter/login`, {
Expand All @@ -28,3 +46,23 @@ export const isExist = async (value: string, type: string) => {

return response;
};

export const fowardPwdLink = async (data: FowardPwdPayload) => {
const response = await api
.post(`auth/shelter/reset-password`, {
json: data
})
.then(res => res.json<FowardPwdResponse>());

return response;
};

export const pwdChange = async (data: PwdChangePayload) => {
const response = await api
.post(`auth/shelter/change-password`, {
json: data
})
.then(res => res.json<PwdChangeResponse>());

return response;
};
5 changes: 1 addition & 4 deletions src/api/shelter/event/useParticipateVolEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ export default function useParticipateVolEvent(
participate(shelterId, volunteerEventId),
{
onSuccess: (data, variables, context) => {
return queryClient.invalidateQueries({
queryKey: queryKey.all,
refetchType: 'all'
});
return queryClient.invalidateQueries();
},
...options
}
Expand Down
5 changes: 1 addition & 4 deletions src/api/shelter/event/useWithdrawVolEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ export default function useWithdrawVolEvent(
({ shelterId, volunteerEventId }) => withdraw(shelterId, volunteerEventId),
{
onSuccess: (data, variables, context) => {
return queryClient.invalidateQueries({
queryKey: queryKey.all,
refetchType: 'all'
});
return queryClient.invalidateQueries();
},
...options
}
Expand Down
5 changes: 4 additions & 1 deletion src/api/shelter/{shelterId}/useBookMarkMutation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMutation } from '@tanstack/react-query';
import { useMutation, useQueryClient } from '@tanstack/react-query';
import useShelterHomeInfo from './useShelterHomeInfo';
import { post } from './bookmark';
import { useRouter } from 'next/navigation';
Expand All @@ -7,12 +7,15 @@ export default function useBookMarkMutation(
shelterId: number,
onSuccessCallback: (bookMarkState: boolean) => void
) {
const queryClient = useQueryClient();

const { refetch } = useShelterHomeInfo(shelterId);
const router = useRouter();
const mutate = useMutation(post, {
onSuccess: data => {
refetch();
onSuccessCallback(data.bookMarked!);
return queryClient.invalidateQueries();
},
onError: () => {
router.replace('/login/volunteer');
Expand Down
36 changes: 25 additions & 11 deletions src/api/shelter/{shelterId}/useObservationAnimalList.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
import { useQuery } from '@tanstack/react-query';
import { get } from './observation-animal';
import {
UseInfiniteQueryOptions,
useInfiniteQuery
} from '@tanstack/react-query';
import { ObservationAnimalInfo, get } from './observation-animal';
import { shelterKey } from '../../queryKey';

export default function useObservationAnimalListAtHome({
shelterId,
page
}: {
shelterId: number;
page: number;
}) {
return useQuery(shelterKey.observationAnimal(), () =>
get({ shelterId, page })
export default function useObservationAnimalListAtHome(
{
shelterId
}: {
shelterId: number;
},
options?: UseInfiniteQueryOptions<ObservationAnimalInfo>
) {
return useInfiniteQuery<ObservationAnimalInfo>(
shelterKey.animalList(shelterId),
({ pageParam = 0 }) => get({ shelterId, page: pageParam }),
{
getNextPageParam: lastPage => {
if (lastPage.content.length === 0) {
return false;
}
return lastPage.pageNumber + 1;
},
...options
}
);
}
Loading