Repository navigation
Feat: 전체 문서 조회 api 변경 - #222
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces the heavy 'getAllDocumentsServer' API call, which fetched all documents including their full content, with a lightweight 'getDocumentTitlesServer' API call targeting the '/document/titles' endpoint. This optimization prevents potential Next.js payload parsing failures by only retrieving necessary metadata ('DocumentTitle'). The changes include updating the documentation, types, API routes, admin pages, static parameter generation, and cache revalidation logic. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
ShinjungOh
left a comment
There was a problem hiding this comment.
리뷰가 늦어 죄송합니다😭
거의 반년 넘게 있었던 문제인데 드디어 해결돼서 개운하네요!!!
추가로 put-document 라우트에 getDocumentTitles 태그 무효화도 추가 부탁드립니다!
어드민에서 최근 편집일도 갱신되게 하려면 문서 수정시에도 태그 무효화가 필요할 것 같아요.
이미 컨벤션 문서까지 잘 업데이트 해주셨는데 리뷰 반영하시면서 바뀌는게 있으면 문서도 업데이트 같이 부탁드려요!!🚀🚀
| }; | ||
| ``` | ||
|
|
||
| ### 목록 조회는 경량 엔드포인트 사용 |
| export type DocumentTitle = TitleAndUUID & { | ||
| generateTime: string; | ||
| }; | ||
|
|
There was a problem hiding this comment.
TitleAndUUID와 DocumentTitle 타입의 위치를 type/Document.type.ts로 옮기면 어떨까요?
서버 쪽과 클라이언트 쪽 모두에서 쓰이니 특정 레이어에 종속된 타입이 아니라 공통 타입 파일에 선언하면 좋겠어요~!
| const response: ApiResponseType<TitleAndUUID[]> = { | ||
| data: documents.map(({title, uuid, documentType}) => ({title, uuid, documentType})), | ||
| data: documents, |
There was a problem hiding this comment.
응답 타입을 const response: ApiResponseType<DocumentTitle[]> = {로 바꾸는게 더 명확해질 것 같아요.
jinhokim98
left a comment
There was a problem hiding this comment.
확인이 너무 늦었습니다... approve 해둘게요
서버와 클라이언트 양쪽에서 사용하는 타입이므로 apis/client/document.ts가 아닌 type/Document.type.ts에 선언합니다. 제목 목록 BFF 응답 타입도 실제 응답에 맞춰 DocumentTitle[]로 명확히 했습니다.
문서 수정도 generateTime을 갱신하므로, 태그를 무효화하지 않으면 관리자 문서 목록의 최근 편집일이 이전 값으로 남습니다.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
56983b4 to
9ba2ced
Compare
issue
구현 사항
getAllDocumentsServer에allDocumentsParams(pageSize 10000)를 넘겨 전체 문서를 본문(contents)까지 포함해 한 번에 불러오면, 문서 수가 많을수록 응답 payload가 커져 Next.js가 파싱에 실패하는 문제가 있었습니다.이를 해결하기 위해 백엔드에 제목 목록 전용 엔드포인트
GET /document/titles(title,uuid,documentType,generateTime반환)가 추가되었고, 이 엔드포인트에 대응하도록 했습니다./document/titles추가), [FEAT]: 전체 문서 제목 조회 API 응답 필드 추가 backend#170 (documentType,generateTime필드 추가)🫡 참고사항