Skip to content

Commit

Permalink
Merge pull request #33 from 21jake/feature/file-upload
Browse files Browse the repository at this point in the history
feature/file-upload
  • Loading branch information
21jake committed Mar 9, 2023
2 parents a778e67 + 22869b6 commit f0673eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/src/services/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,15 @@ export class FileService {
return newEntity;
});

return await this.keywordRepository.save(newEntities);
return await this.keywordRepository.save(this.filterKeywords(newEntities));
}

private filterKeywords = (keywords: Keyword[]) => {
// filter empty keywords and keywords with length > 150
const filteredKeywords = keywords.filter((e) => e.name && e.name.length <= 150);
return filteredKeywords;
};

async streamBatchDetail(batchId: string) {
const batch = await this.batchRepository.findOne({
where: { id: Number(batchId) },
Expand Down

0 comments on commit f0673eb

Please sign in to comment.