Skip to content

Commit 12d6d94

Browse files
AchoArnoldCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1d00212 commit 12d6d94

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

api/pkg/validators/bulk_message_handler_validator.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,14 @@ func (v *BulkMessageHandlerValidator) validateMessages(ctx context.Context, mess
226226
if message.AttachmentURLs != "" {
227227
urls := strings.Split(message.AttachmentURLs, ",")
228228

229-
if len(urls) > 10 {
229+
validAttachmentCount := 0
230+
for _, u := range urls {
231+
if strings.TrimSpace(u) != "" {
232+
validAttachmentCount++
233+
}
234+
}
235+
236+
if validAttachmentCount > 10 {
230237
result.Add("document", fmt.Sprintf("Row [%d]: You cannot attach more than 10 files per message.", index+2))
231238
}
232239

web/pages/threads/_id/index.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@
174174
</v-card-text>
175175
</v-card>
176176
<v-card
177-
v-if="message.attachments"
178-
shaped
179-
>
177+
v-if="message.attachments?.length"
178+
shaped
179+
>
180180
<v-card-title>Message Attachments</v-card-title>
181181
<v-card-text>
182182
<v-row>

0 commit comments

Comments
 (0)