Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE/#458] 신고하기 API 구현 #459

Merged
merged 7 commits into from
Dec 10, 2023
Merged

[BE/#458] 신고하기 API 구현 #459

merged 7 commits into from
Dec 10, 2023

Conversation

koomin1227
Copy link
Member

🚩 관련 이슈

📋 구현 기능 명세

  • 사용자가 게시글을 신고할 수 있는 API 작성
  • 자신의 게시글은 신고 할 수 없도록 수정
  • 없는 유저이거나 삭제된 게시글인 경우 신고등록하지 못하도록 수정

📌 PR Point

  • 추후에 신고관련해서 관리자에게 알림이 가는 기능이나 신고 누적 횟수가 일정이상이면 조치를 가하는 로직이 있으면 좋을 것 같다.

📸 스크린샷

@koomin1227 koomin1227 self-assigned this Dec 10, 2023
@koomin1227 koomin1227 added BE BE 관련 environment 공통 개발 환경 설정 labels Dec 10, 2023
Comment on lines +21 to +33
if (body.user_id === userId) {
throw new HttpException('자신의 게시글은 신고 할 수 없습니다.', 400);
}
if (!isAllExist) {
throw new HttpException('신고할 대상이 존재 하지 않습니다.', 404);
}
const reportEntity = new ReportEntity();
reportEntity.post_id = body.post_id;
reportEntity.user_hash = body.user_id;
reportEntity.description = body.description;
reportEntity.reporter = userId;
await this.reportRepository.save(reportEntity);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

꼼꼼한 오류처리 좋습니다~

@koomin1227 koomin1227 changed the title BE-Report-#458 [BE/#458] 신고하기 API 구현 Dec 10, 2023
@koomin1227 koomin1227 merged commit e71c56b into BE Dec 10, 2023
1 check passed
@koomin1227 koomin1227 deleted the BE-Report-#458 branch December 10, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BE BE 관련 environment 공통 개발 환경 설정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants