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

enhance(backend): antennas/updateの必須項目をantennaIdのみに #13542

Merged
merged 3 commits into from
Mar 10, 2024

Conversation

yupix
Copy link
Contributor

@yupix yupix commented Mar 7, 2024

What

antennas/update の必須項目を antennaId のみに変更しました。

Why

#13398 にもある通りすべて必要だと更新が大変な場合がある為

Additional info (optional)

userListId に関してはsrcが list に指定されている前提でのみ更新を行う都合上、srcall などに変更した後に userListId を更新しようとすると null になるようになっています。

また、src がすでに list に設定されていて、 userListId のみの更新リクエストが来た場合はデータベースから取得したアンテナの srclist かで判断しています。

なにか問題がありましたら教えていただけると幸いです。

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added packages/backend Server side specific issue/PR packages/misskey-js labels Mar 7, 2024
Copy link
Contributor

github-actions bot commented Mar 7, 2024

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -16111,16 +16111,7 @@
                   }
                 },
                 "required": [
-                  "antennaId",
-                  "name",
-                  "src",
-                  "keywords",
-                  "excludeKeywords",
-                  "users",
-                  "caseSensitive",
-                  "withReplies",
-                  "withFile",
-                  "notify"
+                  "antennaId"
                 ]
               }
             }

Get diff files from Workflow Page

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 14.28571% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 66.03%. Comparing base (27f823e) to head (bf3065f).

Files Patch % Lines
...ackend/src/server/api/endpoints/antennas/update.ts 14.28% 6 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@@ -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,
Copy link
Member

Choose a reason for hiding this comment

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

nullに設定することができなくなるかも?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ほんとですね...、 ps.userListId !== undefined で比較するように変更してみました。

@syuilo syuilo merged commit 6b676a9 into misskey-dev:develop Mar 10, 2024
25 checks passed
@syuilo
Copy link
Member

syuilo commented Mar 10, 2024

🙏

@yupix yupix deleted the refactor/antenna-update branch March 10, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR packages/misskey-js
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants