Skip to content

Commit

Permalink
[FIX}: 컬렉션 전체 조회 기능 수정
Browse files Browse the repository at this point in the history
컬렉션 전체 조회에서 response에 books 데이터 추가
  • Loading branch information
aspyo committed Jun 5, 2024
1 parent 86334e1 commit 692aa15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package com.independentbooks.domain.collection.dto.response;

import com.independentbooks.domain.book.domain.Book;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.List;

@Builder
@Getter
@NoArgsConstructor
Expand All @@ -14,4 +17,5 @@ public class CreateCollectionResponse {
private String collection_name;
private String user_nickname;
private String description;
private List<Book> books;
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ResponseEntity<?> getCollections() {
CreateCollectionResponse collectionResponse;
List<CreateCollectionResponse> responses = new ArrayList<>();
for (Collection c : collections) {
collectionResponse = new CreateCollectionResponse(c.getId(), c.getCollection_name(), c.getUser().getNickname(), c.getDescription());
collectionResponse = new CreateCollectionResponse(c.getId(), c.getCollection_name(), c.getUser().getNickname(), c.getDescription(), c.getBooks());
responses.add(collectionResponse);
}

Expand Down

0 comments on commit 692aa15

Please # to comment.