From a9d18e5327d13bb874c90a06261b78891c616a41 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Sat, 23 Mar 2024 17:01:25 +0100 Subject: [PATCH] fixed issues, store now works --- models/repo/repo_repository.go | 2 +- modules/forgefed/federation_service.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/repo/repo_repository.go b/models/repo/repo_repository.go index 5111cfaf22..a814279f8c 100644 --- a/models/repo/repo_repository.go +++ b/models/repo/repo_repository.go @@ -57,7 +57,7 @@ func CreateFederatedRepo(ctx context.Context, repo *FederatedRepo) error { func UpdateFederatedRepo(ctx context.Context, localRepoId int64, federatedRepoList []*FederatedRepo) error { for _, federatedRepo := range federatedRepoList { - if res, err := validation.IsValid(federatedRepo); !res { + if res, err := validation.IsValid(*federatedRepo); !res { return fmt.Errorf("FederationInfo is not valid: %v", err) } } diff --git a/modules/forgefed/federation_service.go b/modules/forgefed/federation_service.go index 93d73064a6..e4427106cf 100644 --- a/modules/forgefed/federation_service.go +++ b/modules/forgefed/federation_service.go @@ -213,7 +213,7 @@ func CreateUserFromAP(ctx context.Context, personID forgefed.PersonID, federatio // Create or update a list of FederatedRepo structs func UpdateFederatedRepoList(ctx context.Context, localRepoId int64, federatedRepoList []string) (int, string, error) { - federatedRepos := make([]*repo.FederatedRepo, len(federatedRepoList)) + federatedRepos := make([]*repo.FederatedRepo, 0, len(federatedRepoList)) for _, uri := range federatedRepoList { federationHost, err := GetFederationHostForUri(ctx, uri) if err != nil {