File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export const getMailbox = async () => {
1313export const getMailboxDetail = async ( id : number , pageParam : number ) => {
1414 try {
1515 const response = await client . get ( `/api/mailbox/${ id } /detail?page=${ pageParam } &size=20` ) ;
16-
16+ console . log ( response . data ) ;
1717 if ( ! response ) throw new Error ( 'error while fetching mailbox detail data' ) ;
1818 return response . data ;
1919 } catch ( error ) {
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { useNavigate } from 'react-router';
33
44import { getUserToken , getMydata , postZipCode } from '@/apis/auth' ;
55import useAuthStore from '@/stores/authStore' ;
6- import useToastStore from '@/stores/toastStore' ;
76
87const AuthCallbackPage = ( ) => {
98 const stateToken = new URLSearchParams ( window . location . search ) . get ( 'state' ) ;
@@ -15,7 +14,6 @@ const AuthCallbackPage = () => {
1514 const setAccessToken = useAuthStore ( ( state ) => state . setAccessToken ) ;
1615 const setZipCode = useAuthStore ( ( state ) => state . setZipCode ) ;
1716 const navigate = useNavigate ( ) ;
18- const setToastActive = useToastStore ( ( state ) => state . setToastActive ) ;
1917
2018 const handleError = ( error : unknown ) => {
2119 console . error ( 'AuthCallback Error:' , error ) ;
Original file line number Diff line number Diff line change @@ -17,11 +17,15 @@ const LetterBoardPage = () => {
1717 const fetchPostList = async ( page : number = 1 ) => {
1818 try {
1919 const response = await getSharePostList ( page ) ;
20- if ( ! response ) throw new Error ( '게시글 목록을 불러오는데 실패했습니다.' ) ;
20+ if ( ! response || ! response . content ) {
21+ console . error ( '게시글 목록을 불러오는데 실패했습니다.' ) ;
22+ return { content : [ ] , currentPage : page , totalPages : 1 } ;
23+ }
2124 console . log ( 'page' , response ) ;
2225 return response as SharePostResponse ;
2326 } catch ( e ) {
2427 console . error ( e ) ;
28+ return { content : [ ] , currentPage : page , totalPages : 1 } ;
2529 }
2630 } ;
2731
@@ -32,7 +36,7 @@ const LetterBoardPage = () => {
3236 enabled : true ,
3337 initialPageParam : 1 ,
3438 getNextPageParam : ( res ) => {
35- if ( ! res || ! res . content || res . currentPage >= res . totalPages ) {
39+ if ( ! res || ! res ? .content || res ? .currentPage >= res ? .totalPages ) {
3640 return undefined ;
3741 }
3842 return res . currentPage + 1 ;
@@ -65,7 +69,7 @@ const LetterBoardPage = () => {
6569 </ p >
6670 </ >
6771 { isLoading ? (
68- < p > loading </ p >
72+ < p className = "body-m text-gray-60 mt-10 text-center" > 로딩 중 입니다. </ p >
6973 ) : postLists ? (
7074 postLists ?. length > 0 ? (
7175 < section className = "mt-6 grid grid-cols-2 gap-x-5 gap-y-4" >
You can’t perform that action at this time.
0 commit comments