-
Notifications
You must be signed in to change notification settings - Fork 0
fix: Event.removeExhibitMemberIdの未実装を修正 #85
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,7 +122,7 @@ export class Event { | |
|
|
||
| public removeMemberId(memberId: string): void { | ||
| for (const exhibit of this.exhibits) { | ||
| if (exhibit.getMemberIds().includes(memberId)) { | ||
| if (exhibit.hasMemberId(memberId)) { | ||
| throw new ExhibitHasMemberException(exhibit.id, memberId); | ||
| } | ||
| } | ||
|
|
@@ -135,7 +135,12 @@ export class Event { | |
| this.memberIds.add(memberId); | ||
| } | ||
|
|
||
| public removeExhibitMemberId(exhibitId: string, memberId: string): void {} | ||
| // NOTE: 展示からの削除のみ行い、Event.memberIdsは操作しない。 | ||
| // 「展示に所属していないがイベント参加者」という状態が有効なため、 | ||
| // イベント参加者からの削除はremoveMemberId()で明示的に行う。 | ||
| public removeExhibitMemberId(exhibitId: string, memberId: string): void { | ||
| this.getExhibitOrThrow(exhibitId).removeMemberId(memberId); | ||
| } | ||
|
KinjiKawaguchi marked this conversation as resolved.
KinjiKawaguchi marked this conversation as resolved.
Comment on lines
+141
to
+143
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: removeExhibitMemberId was previously a no-op — behavioral change for existing callers The Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| toSnapshot() { | ||
| return { | ||
| id: this.id, | ||
|
|
||
|
KinjiKawaguchi marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,10 @@ export class Exhibit { | |
| this.memberIds.delete(memberId); | ||
| } | ||
|
Comment on lines
95
to
96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Exhibit.removeMemberId silently succeeds for non-existent members The (Refers to lines 94-96) Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| public hasMemberId(memberId: string): boolean { | ||
| return this.memberIds.has(memberId); | ||
| } | ||
|
KinjiKawaguchi marked this conversation as resolved.
|
||
|
|
||
| private getLightningTalkOrThrow(): LightningTalk { | ||
| if (!this.lightningTalk) { | ||
| throw new LightningTalkNotFoundException( | ||
|
|
@@ -112,6 +116,7 @@ export class Exhibit { | |
| markdownContent: this.markdownContent, | ||
| url: this.url, | ||
| lightningTalk: this.lightningTalk?.toSnapshot(), | ||
| memberIds: Array.from(this.memberIds), | ||
|
KinjiKawaguchi marked this conversation as resolved.
|
||
| }; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.