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

feat BE 유저 참여 API 구현 #65

Merged
merged 17 commits into from
Nov 23, 2022
Merged

feat BE 유저 참여 API 구현 #65

merged 17 commits into from
Nov 23, 2022

Conversation

pushedrumex
Copy link
Member

Feature

  • 배경
    사용자가 러닝 모집에 참여하기 위한 API를 구현한다.
  • 목적
    사용자가 러닝 모집에 참여하도록 하기 위함

과정

  • user_recruit 레포지토리를 생성한 후 recruit에 주입시켜 모집 등록을 위한 메서드를 구현한다.

결과 (스크린샷 등)

  1. 유저 참여에 성공한 경우
    image

  2. 모집 글이 없거나 삭제된 경우
    image

  3. 모집 글 게시자와 참여하려는 유저가 동일한 경우
    image

  4. 이미 해당 모집에 참여한 경우
    image

  5. 모집이 완료된 경우
    image

관련 issue 번호 (링크)

#60

테스트 방법

POST localhost:4000/recruit/join

{
    "recruitId": "1",
    "userId": "1"
} 

Commit

@pushedrumex pushedrumex self-assigned this Nov 22, 2022
}

async isParticipaite(recruitId: number, userId: number): Promise<boolean> {
return this.userRecruitRepository.isParticipate(recruitId, userId);
Copy link
Collaborator

@claycat claycat Nov 23, 2022

Choose a reason for hiding this comment

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

오타 : isParticipate
근데 네이밍자체는 isParticipating 이 좀 나을수도 있을꺼같아요

Copy link
Member Author

Choose a reason for hiding this comment

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

오 수정하겠습니다!

return await this.findOneBy({ id: recruitId });
}

async getMaxPpl(recruitId: number) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

getMaxPeople 의 줄임말같은데 굳이 줄일 필요가 있을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

db에 maxPpl로 저장되어있어서 통일성을 위해 Ppl로 했습니다

});
}

async findOneById(recruitId: number): Promise<Recruit | undefined> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

find"One"ById 에서 "one" 이 어떤거인지 잘 모르겠어요

Copy link
Member Author

@pushedrumex pushedrumex Nov 23, 2022

Choose a reason for hiding this comment

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

recruit입니다

Copy link
Member

@gchoi96 gchoi96 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@June1010 June1010 left a comment

Choose a reason for hiding this comment

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

LGTM

@claycat claycat merged commit 27a916a into develop Nov 23, 2022
@pushedrumex pushedrumex deleted the feat/participate-be branch November 23, 2022 02:41
gchoi96 added a commit that referenced this pull request Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants