fix(server): prevent creation of empty antennas

This commit is contained in:
syuilo
2023-03-15 18:09:00 +09:00
parent a8bd3e8e53
commit 63068fc0c2
2 changed files with 5 additions and 0 deletions

View File

@ -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,
});