-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
enhance(backend): antennas/updateの必須項目をantennaIdのみに #13542
Conversation
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -16111,16 +16111,7 @@
}
},
"required": [
- "antennaId",
- "name",
- "src",
- "keywords",
- "excludeKeywords",
- "users",
- "caseSensitive",
- "withReplies",
- "withFile",
- "notify"
+ "antennaId"
]
}
} |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #13542 +/- ##
============================================
- Coverage 77.90% 66.03% -11.87%
============================================
Files 186 988 +802
Lines 25294 115272 +89978
Branches 484 5723 +5239
============================================
+ Hits 19705 76121 +56416
- Misses 5582 37715 +32133
- Partials 7 1436 +1429 ☔ View full report in Codecov by Sentry. |
@@ -112,7 +114,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- | |||
await this.antennasRepository.update(antenna.id, { | |||
name: ps.name, | |||
src: ps.src, | |||
userListId: userList ? userList.id : null, | |||
userListId: ps.userListId ? userList ? userList.id : null : undefined, |
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.
nullに設定することができなくなるかも?
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.
ほんとですね...、 ps.userListId !== undefined
で比較するように変更してみました。
🙏 |
What
antennas/update
の必須項目をantennaId
のみに変更しました。Why
#13398 にもある通りすべて必要だと更新が大変な場合がある為
Additional info (optional)
userListId
に関してはsrcがlist
に指定されている前提でのみ更新を行う都合上、src
をall
などに変更した後にuserListId
を更新しようとするとnull
になるようになっています。また、
src
がすでにlist
に設定されていて、userListId
のみの更新リクエストが来た場合はデータベースから取得したアンテナのsrc
がlist
かで判断しています。なにか問題がありましたら教えていただけると幸いです。
Checklist