diff --git a/backend/pkg/database/gorm_common.go b/backend/pkg/database/gorm_common.go index 4b006b66..3863da82 100644 --- a/backend/pkg/database/gorm_common.go +++ b/backend/pkg/database/gorm_common.go @@ -573,7 +573,7 @@ func (gr *GormRepository) AddResourceComposition(ctx context.Context, compositio } //generate placeholder source - placeholderSource := models.SourceCredential{UserID: currentUser.ID, SourceType: "manual", ModelBase: models.ModelBase{ID: uuid.MustParse("00000000-0000-0000-0000-000000000000")}} + placeholderSource := models.SourceCredential{UserID: currentUser.ID, SourceType: "manual", ModelBase: models.ModelBase{ID: uuid.Nil}} existingCompositionResources := []*models.ResourceBase{} rawResourceLookupTable := map[string]*models.ResourceBase{} diff --git a/backend/pkg/database/gorm_repository_test.go b/backend/pkg/database/gorm_repository_test.go index c67ffeff..53d0816d 100644 --- a/backend/pkg/database/gorm_repository_test.go +++ b/backend/pkg/database/gorm_repository_test.go @@ -1190,7 +1190,7 @@ func (suite *RepositoryTestSuite) TestAddResourceComposition_WithExistingComposi //assert that the associations were created associations, err := dbRepo.FindResourceAssociationsByTypeAndId(authContext, - &models.SourceCredential{UserID: userModel.ID, ModelBase: models.ModelBase{ID: uuid.MustParse("00000000-0000-0000-0000-000000000000")}}, //Compositions have a unique/placeholder credential ID + &models.SourceCredential{UserID: userModel.ID, ModelBase: models.ModelBase{ID: uuid.Nil}}, //Compositions have a unique/placeholder credential ID "Composition", compositions[0].SourceResourceID) require.NoError(suite.T(), err) require.Equal(suite.T(), 5, len(associations))