feat: complete shared database tenant sharding
This commit is contained in:
@@ -461,18 +461,20 @@ func (s *testSecurityStore) CountUnreadSystemNotificationsByEventPrefix(tenantID
|
||||
return count, s.err
|
||||
}
|
||||
|
||||
func (s *testSecurityStore) MarkSystemNotificationRead(tenantID types.TenantID, uid types.Uid, eventID string, readAt time.Time) error {
|
||||
func (s *testSecurityStore) MarkSystemNotificationRead(tenantID types.TenantID, uid types.Uid, eventID string, readAt time.Time) (*types.SystemNotification, error) {
|
||||
s.readTenant = tenantID
|
||||
s.readUser = uid
|
||||
s.readNotificationID = eventID
|
||||
for i := range s.notifications {
|
||||
if s.notifications[i].EventID == eventID {
|
||||
s.notifications[i].ReadAt = &readAt
|
||||
return s.err
|
||||
if s.notifications[i].ReadAt == nil {
|
||||
s.notifications[i].ReadAt = &readAt
|
||||
}
|
||||
return &s.notifications[i], s.err
|
||||
}
|
||||
}
|
||||
if s.err != nil {
|
||||
return s.err
|
||||
return nil, s.err
|
||||
}
|
||||
return types.ErrNotFound
|
||||
return nil, types.ErrNotFound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user