fix group tests

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
This commit is contained in:
bcmmbaga
2024-10-18 10:48:28 +03:00
parent a82b5ce80e
commit 97dbdd7940
3 changed files with 10 additions and 3 deletions
+3
View File
@@ -1245,6 +1245,9 @@ func (s *SqlStore) GetGroupByID(ctx context.Context, lockStrength LockingStrengt
result := s.db.WithContext(ctx).Clauses(clause.Locking{Strength: string(lockStrength)}).
First(&group, accountAndIDQueryCondition, accountID, groupID)
if err := result.Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, status.Errorf(status.NotFound, "group not found")
}
log.WithContext(ctx).Errorf("failed to get group from the store: %s", err)
return nil, status.Errorf(status.Internal, "failed to get group from store")
}