add priority ids at outgoing letter
This commit is contained in:
@@ -211,6 +211,7 @@ func (s *LetterOutgoingServiceImpl) ListOutgoingLetters(ctx context.Context, req
|
||||
DepartmentID: req.DepartmentID,
|
||||
ReceiverInstitutionID: req.ReceiverInstitutionID,
|
||||
PriorityID: req.PriorityID,
|
||||
PriorityIDs: req.PriorityIDs,
|
||||
UserID: &userID,
|
||||
IsRead: req.IsRead,
|
||||
}
|
||||
@@ -219,6 +220,10 @@ func (s *LetterOutgoingServiceImpl) ListOutgoingLetters(ctx context.Context, req
|
||||
filter.DepartmentID = &departmentID
|
||||
}
|
||||
|
||||
if len(req.PriorityIDs) > 0 {
|
||||
filter.PriorityIDs = req.PriorityIDs
|
||||
}
|
||||
|
||||
if req.Status != "" {
|
||||
filter.Status = &req.Status
|
||||
}
|
||||
@@ -300,7 +305,6 @@ func (s *LetterOutgoingServiceImpl) ListOutgoingLetters(ctx context.Context, req
|
||||
|
||||
result := batchResult{}
|
||||
errChan := make(chan error, 4)
|
||||
|
||||
|
||||
// Load attachments
|
||||
go func() {
|
||||
@@ -308,7 +312,7 @@ func (s *LetterOutgoingServiceImpl) ListOutgoingLetters(ctx context.Context, req
|
||||
errChan <- err
|
||||
}()
|
||||
|
||||
// Load recipients
|
||||
// Load recipients
|
||||
go func() {
|
||||
result.recipients, err = s.processor.GetBatchRecipients(ctx, letterIDs)
|
||||
errChan <- err
|
||||
@@ -366,7 +370,6 @@ func (s *LetterOutgoingServiceImpl) ListOutgoingLetters(ctx context.Context, req
|
||||
if recipient, exists := recipientByUser[letter.ID]; exists && recipient != nil {
|
||||
isRead = recipient.ReadAt != nil
|
||||
}
|
||||
|
||||
|
||||
response := transformLetterToResponse(&letter)
|
||||
response.IsRead = isRead
|
||||
@@ -1906,4 +1909,4 @@ func (s *LetterOutgoingServiceImpl) extractUserIDsFromMentions(mentions map[stri
|
||||
}
|
||||
|
||||
return userIDs
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user