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
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy

on:
push:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest
container: pandoc/latex
steps:
- uses: actions/checkout@v2

- name: Install mustache (to update the date)
run: apk add ruby && gem install mustache

- name: creates output
run: sh ./build.sh

- name: Pushes to another repository
id: push_directory
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.AUTO_ACTIONS }}
with:
source-directory: "output"
destination-github-username: [ynjii]
destination-repository-name: [livin]
user-email: ${{ secrets.EMAIL }}
commit-message: ${{ github.event.commits[0].message }}
target-branch: main

- name: Test get variable exported by push-to-another-repository
run: echo $DESTINATION_CLONED_DIRECTORY
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
cd ../
mkdir output
cp -R ./[Frontend]/* ./output
cp -R ./output ./[Frontend]/
35 changes: 6 additions & 29 deletions livin/app/houses/review/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
deleteCommentApi,
getCommentsApi,
} from '@apis/comment';
import axiosInstance from '@apis/axiosInstance';

interface ReviewDetail {
id: number;
Expand Down Expand Up @@ -59,18 +58,8 @@ export default function HouseDetailPage() {
);
setReview(data);

// 댓글 데이터 로드
const reviewId = Number(params.id);
console.log('[DEBUG] 하숙/자취 댓글 조회 시작 - reviewId:', reviewId, 'houseId:', houseId);
// comment.ts must not be changed; use direct axios call for house-scoped endpoint
let commentsData;
if (houseId) {
const res = await axiosInstance.get(`/house/${houseId}/review/${reviewId}/comment`);
commentsData = res.data;
} else {
commentsData = await getCommentsApi(reviewId);
}
console.log('[DEBUG] 하숙/자취 댓글 조회 응답:', commentsData);
// 댓글 데이터 로드 (houseId 없이 reviewId만 넘김)
const commentsData = await getCommentsApi(Number(params.id));
setComments(commentsData.comments);
} catch (error) {
console.error('Failed to fetch review detail:', error);
Expand Down Expand Up @@ -143,14 +132,8 @@ export default function HouseDetailPage() {
content: commentText,
anonymous: isAnonymous,
});
// 댓글 목록 새로고침
let commentsData;
if (houseId) {
const res = await axiosInstance.get(`/house/${houseId}/review/${reviewId}/comment`);
commentsData = res.data;
} else {
commentsData = await getCommentsApi(reviewId);
}
// 댓글 목록 새로고침 (houseId 없이 reviewId만 넘김)
const commentsData = await getCommentsApi(reviewId);
setComments(commentsData.comments);
setCommentText('');
} catch (error) {
Expand All @@ -168,14 +151,8 @@ export default function HouseDetailPage() {
try {
const reviewId = Number(params.id);
await deleteCommentApi(commentId);
// 댓글 목록 새로고침
let commentsData;
if (houseId) {
const res = await axiosInstance.get(`/house/${houseId}/review/${reviewId}/comment`);
commentsData = res.data;
} else {
commentsData = await getCommentsApi(reviewId);
}
// 댓글 목록 새로고침 (houseId 없이 reviewId만 넘김)
const commentsData = await getCommentsApi(reviewId);
setComments(commentsData.comments);
} catch (error) {
console.error('댓글 삭제 실패:', error);
Expand Down