Skip to content

Commit

Permalink
fix(server): prevent creation of empty antennas
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Mar 15, 2023
1 parent a8bd3e8 commit 63068fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ You should also include the user name that made the change.
- Bookwyrmのユーザーのプロフィールページで「リモートで表示」をタップしても反応がない問題を修正
- `disableCache: true`を設定している場合に絵文字管理操作でエラーが出る問題を修正
- リテンション分析が上手く機能しないことがあるのを修正
- 空のアンテナが作成できないように修正

## 13.9.2 (2023/03/06)

Expand Down
4 changes: 4 additions & 0 deletions packages/backend/src/server/api/endpoints/antennas/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
private globalEventService: GlobalEventService,
) {
super(meta, paramDef, async (ps, me) => {
if (ps.keywords.length === 0) {
throw new Error('invalid param');
}

const currentAntennasCount = await this.antennasRepository.countBy({
userId: me.id,
});
Expand Down

0 comments on commit 63068fc

Please sign in to comment.