tsk-59: Changes to store and mock package
This commit is contained in:
@@ -62,3 +62,21 @@ func (m *MockMessageEventResponseStore) Create(ctx context.Context, mer *message
|
||||
}
|
||||
|
||||
// TODO: Add code to get mock MessageEventResponse
|
||||
func (m *MockMessageEventResponseStore) GetWithUserId(ctx context.Context, userId uuid.UUID) ([]*message.MessageEventResponse, error) {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
|
||||
if m.Error != nil {
|
||||
return nil, m.Error
|
||||
}
|
||||
|
||||
var messages []*message.MessageEventResponse
|
||||
for _, msg := range m.MessageEventResponses {
|
||||
if msg.UserId == userId {
|
||||
messages = append(messages, msg)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return messages, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user