-
Notifications
You must be signed in to change notification settings - Fork 0
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:試合表の生成後のエントリーを受け付けないように変更 #551
base: main
Are you sure you want to change the base?
Conversation
Deploying kcmsx with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
試合が存在する時にチーム登録 or チーム削除も同様の処理(とテスト)を書いて欲しいです
@@ -15,6 +19,11 @@ export class EntryService { | |||
*/ | |||
async enter(teamID: TeamID): Promise<Result.Result<Error, Team>> { | |||
const teamRes = await this.teamRepository.findByID(teamID); | |||
const matchRes = await this.preMatch.findAllPreMatch(); | |||
|
|||
if (!Result.isErr(matchRes)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここはResult.isOk
を使うべき
- 試合があるのにエラーが起きない場合もあるはずなので、ここは帰ってきた件数をみるべきだと思う
あとcancelとenterで処理一緒なので共通化して欲しい
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
試合が存在する時にエントリー or エントリー解除できないことをテストして欲しいです
const matchRes = await this.preMatch.findAllPreMatch(); | ||
|
||
if (!Result.isErr(matchRes)) { | ||
return Result.err(new Error('Cannot enter now')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
キャンセルなのでCannot cancel entry now
などにするべきです。また、共通化するならmodify entry
などでもいいでしょう。
close #366