Merge pull request 'Updated approval script' (#163) from fix-permissions into main
Deploy / deploy (push) Successful in 47s
Details
Deploy / deploy (push) Successful in 47s
Details
Reviewed-on: https://72.56.235.246.nip.io/gitea/romanskijdev/ruspet_portal_back/pulls/163
This commit is contained in:
commit
4ccb4d337d
|
|
@ -430,13 +430,14 @@ func (s *MonthlyOrderService) SubmitOrdersToTelegram(ctx context.Context, manage
|
|||
order.Items = append(order.Items, *item)
|
||||
}
|
||||
|
||||
if len(files) > 0 {
|
||||
contentBuilder.WriteString(fmt.Sprintf("\n📎 <b>Прикреплено скринов:</b> %d шт.\n", len(files)))
|
||||
for _, f := range files {
|
||||
if f.FileName != nil {
|
||||
contentBuilder.WriteString(fmt.Sprintf(" • %s\n", *f.FileName))
|
||||
}
|
||||
}
|
||||
// Заполняем поле Files у структуры Approval, чтобы Notifier мог их отправить как медиа
|
||||
var approvalFiles []*typescore.ApprovalFile
|
||||
for _, f := range files {
|
||||
fileCopy := f
|
||||
approvalFiles = append(approvalFiles, &typescore.ApprovalFile{
|
||||
FileName: fileCopy.FileName,
|
||||
FileBase64: fileCopy.FileBase64,
|
||||
})
|
||||
}
|
||||
|
||||
if order.ManagerComment != nil {
|
||||
|
|
@ -455,6 +456,7 @@ func (s *MonthlyOrderService) SubmitOrdersToTelegram(ctx context.Context, manage
|
|||
TopicID: &topicID,
|
||||
Content: &contentStr,
|
||||
Status: &status,
|
||||
Files: approvalFiles, // 👈 Передаем файлы сюда
|
||||
}
|
||||
|
||||
// Если у структуры Approval или в методе CreateApprovalDB есть возможность пробросить файлы/вложения,
|
||||
|
|
|
|||
Loading…
Reference in New Issue