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
2 changes: 0 additions & 2 deletions src/api/books/getBookDetail.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { apiClient } from '../index';

// 책 상세 정보 타입
export interface BookDetail {
title: string;
imageUrl: string;
Expand All @@ -13,7 +12,6 @@ export interface BookDetail {
isSaved: boolean;
}

// API 응답 타입
export interface BookDetailResponse {
isSuccess: boolean;
code: number;
Expand Down
3 changes: 0 additions & 3 deletions src/api/books/getMostSearchedBooks.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import { apiClient } from '../index';

// 인기 검색 도서 타입
export interface MostSearchedBook {
rank: number;
title: string;
imageUrl: string;
isbn: string;
}

// API 응답 데이터 타입
export interface MostSearchedBooksData {
bookList: MostSearchedBook[];
}

// API 응답 타입
export interface MostSearchedBooksResponse {
isSuccess: boolean;
code: number;
Expand Down
3 changes: 0 additions & 3 deletions src/api/books/getRecruitingRooms.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { apiClient } from '../index';

// 모집중인 모임방 타입
export interface RecruitingRoom {
roomId: number;
bookImageUrl: string;
Expand All @@ -11,15 +10,13 @@ export interface RecruitingRoom {
isPublic: boolean;
}

// API 응답 데이터 타입
export interface RecruitingRoomsData {
recruitingRoomList: RecruitingRoom[];
totalRoomCount: number;
nextCursor: string;
isLast: boolean;
}

// API 응답 타입
export interface RecruitingRoomsResponse {
isSuccess: boolean;
code: number;
Expand Down
9 changes: 4 additions & 5 deletions src/api/books/getSearchBooks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { apiClient } from '../index';

// 검색된 책 타입 (API 응답에서 받는 형태)
export interface BookSearchItem {
title: string;
imageUrl: string;
Expand All @@ -9,7 +8,6 @@ export interface BookSearchItem {
isbn: string;
}

// 검색된 책 타입 (컴포넌트에서 사용하는 형태)
export interface SearchedBook {
id: number;
title: string;
Expand All @@ -19,7 +17,6 @@ export interface SearchedBook {
isbn: string;
}

// API 응답 데이터 타입
export interface SearchBooksData {
searchResult: BookSearchItem[];
page: number;
Expand All @@ -30,7 +27,6 @@ export interface SearchBooksData {
first: boolean;
}

// API 응답 타입
export interface SearchBooksResponse {
isSuccess: boolean;
code: number;
Expand Down Expand Up @@ -58,7 +54,10 @@ export const getSearchBooks = async (
}
};

export const convertToSearchedBooks = (apiBooks: BookSearchItem[], startIndex: number = 0): SearchedBook[] => {
export const convertToSearchedBooks = (
apiBooks: BookSearchItem[],
startIndex: number = 0,
): SearchedBook[] => {
return apiBooks.map((book, index) => ({
id: startIndex + index + 1,
title: book.title,
Expand Down
3 changes: 0 additions & 3 deletions src/api/books/postSaveBook.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { apiClient } from '../index';

// 북마크 요청 타입
export interface SaveBookRequest {
type: boolean;
}

// 북마크 응답 데이터 타입
export interface SaveBookData {
isbn: string;
isSaved: boolean;
}

// 북마크 응답 타입
export interface SaveBookResponse {
isSuccess: boolean;
code: number;
Expand Down
1 change: 0 additions & 1 deletion src/api/recentsearch/deleteRecentSearch.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { apiClient } from '../index';

// 최근 검색어 삭제 응답 타입
export interface DeleteRecentSearchResponse {
isSuccess: boolean;
code: number;
Expand Down
2 changes: 0 additions & 2 deletions src/api/rooms/getMyRooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { apiClient } from '../index';

export type RoomType = 'playingAndRecruiting' | 'recruiting' | 'playing' | 'expired';

// 방 데이터 타입
export interface Room {
roomId: number;
bookImageUrl: string;
Expand All @@ -14,7 +13,6 @@ export interface Room {
isPublic: boolean;
}

// 내 방 조회 응답 타입
export interface MyRoomsResponse {
isSuccess: boolean;
code: number;
Expand Down
3 changes: 0 additions & 3 deletions src/api/rooms/getRoomDetail.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { apiClient } from '../index';
import { AxiosError } from 'axios';

// 방 상세 정보 응답 타입
export interface RoomDetailResponse {
isSuccess: boolean;
code: number;
Expand Down Expand Up @@ -47,12 +46,10 @@ export const getRoomDetail = async (roomId: number): Promise<RoomDetailResponse>
console.error('방 상세 정보 조회 API 오류:', error);

if (error instanceof AxiosError) {
// 모집기간이 만료된 방인 경우
if (error.response?.data?.code === 100004) {
throw new Error('모집기간이 만료된 방입니다.');
}

// 방 접근 권한이 없는 경우
if (error.response?.data?.code === 140011) {
throw new Error('방 접근 권한이 없습니다.');
}
Expand Down
1 change: 0 additions & 1 deletion src/api/rooms/getRoomsByCategory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { apiClient } from '../index';

// 방 목록 응답 데이터 타입
export interface RoomItem {
roomId: number;
bookImageUrl: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/group/MyGroupModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const MyGroupModal = ({ onClose }: MyGroupModalProps) => {
useEffect(() => {
const tryFill = async () => {
if (!contentRef.current || isLast) return;
let guard = 2; // 최대 3페이지까지 자동 프리로드(필요시 늘리기)
let guard = 2;
while (
guard-- > 0 &&
contentRef.current &&
Expand Down Expand Up @@ -284,7 +284,7 @@ const ErrorMessage = styled.div`
`;

const EmptyState = styled.div`
grid-column: 1 / -1; /* 그리드 2열일 때도 전체 너비 차지 */
grid-column: 1 / -1;
flex: 1;
min-height: 78vh;
display: flex;
Expand Down
2 changes: 0 additions & 2 deletions src/components/search/BookSearchResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ export function BookSearchResult({
))
)}

{/* 로딩 상태 표시 */}
{isLoading && searchedBookList.length > 0 && <></>}

{/* 더 이상 데이터가 없음을 표시 */}
{!hasMore && searchedBookList.length > 0 && <></>}
</List>
</Wrapper>
Expand Down
1 change: 0 additions & 1 deletion src/pages/groupDetail/GroupDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// src/pages/group/GroupDetail.tsx
import { useState, useEffect } from 'react';
import {
Wrapper,
Expand Down
1 change: 0 additions & 1 deletion src/stores/usePopupStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// usePopupStore.ts
import { create } from 'zustand';

export type PopupType =
Expand Down