From 8baf13da053133a1a83fb00eeed87daf3054ac91 Mon Sep 17 00:00:00 2001 From: sunny2you <59430564+sunny2you@users.noreply.github.com> Date: Sat, 12 Oct 2024 12:29:11 +0900 Subject: [PATCH] =?UTF-8?q?[BOOK-28]-reviewResponse=EC=97=90=20book=20null?= =?UTF-8?q?=20=EC=B2=B4=ED=81=AC=20=EC=B6=94=EA=B0=80=20(#16)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 4 ++-- .../goorm/unit/booklog/common/config/SecurityConfig.java | 2 +- .../domain/review/presentation/response/ReviewResponse.java | 2 +- src/main/resources/application.yml | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index baa4a38..9b1e9ef 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -49,5 +49,5 @@ jobs: password: ${{ secrets.TEAM_SERVER_PASSWORD }} port: ${{ secrets.TEAM_SERVER_PORT }} script: | - sudo docker-compose -f ../docker-compose.yml pull - sudo docker-compose -f ../docker-compose.yml up -d \ No newline at end of file + echo "${{ secrets.TEAM_SERVER_PASSWORD }}" | sudo -S docker-compose -f /home/haneum/docker-compose.yml pull + echo "${{ secrets.TEAM_SERVER_PASSWORD }}" | sudo -S docker-compose -f /home/haneum/docker-compose.yml up -d \ No newline at end of file diff --git a/src/main/java/goorm/unit/booklog/common/config/SecurityConfig.java b/src/main/java/goorm/unit/booklog/common/config/SecurityConfig.java index 67361b5..60b1b2f 100644 --- a/src/main/java/goorm/unit/booklog/common/config/SecurityConfig.java +++ b/src/main/java/goorm/unit/booklog/common/config/SecurityConfig.java @@ -78,7 +78,7 @@ CorsConfigurationSource corsConfigurationSource() { CorsConfiguration config = new CorsConfiguration(); config.setAllowedHeaders(Collections.singletonList("*")); config.setAllowedMethods(Collections.singletonList("*")); - config.setAllowedOriginPatterns(Arrays.asList("http://localhost:5173")); + config.setAllowedOriginPatterns(Arrays.asList("http://localhost:5173","https://team1-booklog.vercel.app/")); config.setAllowCredentials(true); return config; }; diff --git a/src/main/java/goorm/unit/booklog/domain/review/presentation/response/ReviewResponse.java b/src/main/java/goorm/unit/booklog/domain/review/presentation/response/ReviewResponse.java index f82a9c3..c64f13e 100644 --- a/src/main/java/goorm/unit/booklog/domain/review/presentation/response/ReviewResponse.java +++ b/src/main/java/goorm/unit/booklog/domain/review/presentation/response/ReviewResponse.java @@ -60,7 +60,7 @@ public static ReviewResponse of(Review review) { .userId(review.getUser().getId()) .content(review.getContent()) .file(review.getFile() != null ? FileResponse.from(review.getFile()) : null) - .book(BookResponse.from(review.getBook())) + .book(review.getBook() != null ? BookResponse.from(review.getBook()) : null) .createdAt(review.getCreatedAt().format(formatter)) .updatedAt(review.getUpdatedAt().format(formatter)) .build(); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index dc6161d..1faab2f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -24,9 +24,8 @@ spring: data: redis: - host: ${REDIS_HOST:localhost} - port: ${REDIS_PORT:6379} - password: ${REDIS_PASSWORD} + host: redis + port: 6379 springdoc: default-consumes-media-type: application/json