Skip to content

Commit 4dc9a05

Browse files
committed
fix: 댓글 삭제 시 204 응답을 정상 처리하게 수정
1 parent 967ae1f commit 4dc9a05

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/app/api/comments/manage/[id]/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ export async function DELETE(
8383
const duration = Date.now() - startTime;
8484
logger.info(`DELETE /comments/manage/${id} - 성공 (${status}) [${duration}ms]`);
8585

86+
if (status === 204) {
87+
return new Response(null, { status: 204 });
88+
}
89+
8690
return NextResponse.json({ success: true }, { status });
8791
} catch (error: unknown) {
8892
const duration = Date.now() - startTime;

src/app/api/posts/[id]/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ export async function DELETE(
151151
logger.info(`DELETE /posts/${id} - 성공 (${status}) [${duration}ms]`);
152152
logger.debug(`Response data:`, data);
153153

154+
if (status === 204) {
155+
return new Response(null, { status: 204 });
156+
}
157+
154158
return NextResponse.json(data, { status });
155159
} catch (error: unknown) {
156160
const duration = Date.now() - startTime;

0 commit comments

Comments
 (0)