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] 인원 수정 및 삭제 API 통합 #964

Open
wants to merge 2 commits into
base: be-dev
Choose a base branch
from
Open

Conversation

Arachneee
Copy link
Contributor

issue

API

/api/admin/events/{eventId}/members

Request

{
	"members" : [ 
		{ 
			"id" : 1, 
			"name" : "토다리", 
			"isDeposited": true 
		},
		{ 
			"id" : 2, 
			"name" : "망쵸", 
			"isDeposited": false 
		}
	]
}

구현 사항

멤버 정보 수정 API 호출시 누락된 member는 자동으로 삭제 됩니다.
(id 1,2,3 인 멤버가 존재하는 경우 id 1,2 만 수정 요청시 id 3은 삭제됨)

@Arachneee Arachneee added the ⌨️ BE Backend label Jan 20, 2025
@Arachneee Arachneee added this to the v3.1.4 milestone Jan 20, 2025
@Arachneee Arachneee requested a review from soi-ha January 20, 2025 11:01
@Arachneee Arachneee self-assigned this Jan 20, 2025
Copy link

github-actions bot commented Jan 20, 2025

Test Results

135 tests  ±0   135 ✅ ±0   7s ⏱️ ±0s
 25 suites ±0     0 💤 ±0 
 25 files   ±0     0 ❌ ±0 

Results for commit 28e43a4. ± Comparison against base commit 7a10188.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@soi-ha soi-ha left a comment

Choose a reason for hiding this comment

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

요청했던 부분 반영해주셔서 감사합니다! api 요청이 많이 줄어들 것 같아서 좋네용!!!

Comment on lines +74 to +86

deleteMembers(token, originEventMembers, updatedMembers);
eventMemberRepository.saveAll(updatedMembers.getMembers());
}

private void deleteMembers(String token, List<EventMember> originEventMembers, UpdatedMembers updatedMembers) {
for (EventMember originEventMember : originEventMembers) {
if (!updatedMembers.contain(originEventMember)) {
deleteMember(token, originEventMember);
}
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

pr에 써주신 것처럼
1,2,3이 있다고 했을 때, 1은 상태 변화가 있고 2,3은 없다면. 그리고 3을 삭제하고 싶다면
1,2만 PUT 요청하면 된다는 것이죠?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

맞아요! 프론트 작업 끝나면 같이 머지해야겠네요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⌨️ BE Backend
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants