db/events: don't add tags to query unless they exist

This commit is contained in:
Alex Gleason 2023-08-19 15:26:41 -05:00
parent 19901eb828
commit a82ae40c43
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 5 additions and 3 deletions

View File

@ -43,9 +43,11 @@ function insertEvent(event: Event): Promise<void> {
return results;
}, []);
await trx.insertInto('tags')
.values(tags)
.execute();
if (tags.length) {
await trx.insertInto('tags')
.values(tags)
.execute();
}
});
}