Skip to content

Commit 76b06e7

Browse files
committed
Merge branch 'chat-profile-message' into 'master'
Add message attribute to profile message See merge request joinimpact/api!69
2 parents af254d8 + 096685f commit 76b06e7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

internal/conversations/service.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func (s *service) parseMessage(ctx context.Context, messageType string, rawMessa
456456
return nil, err
457457
}
458458

459-
view, err := s.getMessageVolunteerRequestProfileView(ctx, body.UserID)
459+
view, err := s.getMessageVolunteerRequestProfileView(ctx, body.UserID, body.Message)
460460
if err != nil {
461461
return nil, err
462462
}
@@ -527,7 +527,7 @@ func (s *service) parseMessage(ctx context.Context, messageType string, rawMessa
527527
}
528528

529529
// getMessageVolunteerRequestProfileView gets a MessageVolunteerRequestProfileView for a user by ID.
530-
func (s *service) getMessageVolunteerRequestProfileView(ctx context.Context, userID int64) (*MessageVolunteerRequestProfileView, error) {
530+
func (s *service) getMessageVolunteerRequestProfileView(ctx context.Context, userID int64, message string) (*MessageVolunteerRequestProfileView, error) {
531531
profile := &MessageVolunteerRequestProfileView{}
532532
// Find the user to verify that it is active.
533533
user, err := s.userRepository.FindByID(userID)
@@ -540,6 +540,7 @@ func (s *service) getMessageVolunteerRequestProfileView(ctx context.Context, use
540540
profile.LastName = user.LastName
541541
profile.ProfilePicture = user.ProfilePicture
542542
profile.DateOfBirth = user.DateOfBirth
543+
profile.Message = message
543544

544545
// Find all UserTag objects by UserID.
545546
userTags, err := s.userTagRepository.FindByUserID(userID)

internal/conversations/view.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type MessageVolunteerRequestProfileView struct {
3838
Tags []models.Tag `json:"tags"` // the user's tags
3939
Location *location.Location `json:"location,omitempty" scope:"owner"` // a formatted location
4040
ProfileFields []models.UserProfileField `json:"profile"` // the user's profile fields
41+
Message string `json:"message"`
4142
}
4243

4344
// PreviousExperience represents a user's previous experience.

0 commit comments

Comments
 (0)