mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 06:25:31 +00:00
Rename to StoreFederatedRepo*
This commit is contained in:
parent
ca7d1c6f78
commit
35d3fc199c
|
@ -24,8 +24,7 @@ func FindFederatedRepoByRepoID(ctx context.Context, repoId int64) ([]*FederatedR
|
|||
return federatedRepoList, sess.Find(&federatedRepoList)
|
||||
}
|
||||
|
||||
// ToDo: Name this ...repos
|
||||
func UpdateFederatedRepo(ctx context.Context, localRepoId int64, federatedRepoList []*FederatedRepo) error {
|
||||
func StoreFederatedRepos(ctx context.Context, localRepoId int64, federatedRepoList []*FederatedRepo) error {
|
||||
for _, federatedRepo := range federatedRepoList {
|
||||
if res, err := validation.IsValid(*federatedRepo); !res {
|
||||
return fmt.Errorf("FederationInfo is not valid: %v", err)
|
||||
|
|
|
@ -212,7 +212,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) {
|
||||
func StoreFederatedRepoList(ctx context.Context, localRepoId int64, federatedRepoList []string) (int, string, error) {
|
||||
federatedRepos := make([]*repo.FederatedRepo, 0, len(federatedRepoList))
|
||||
for _, uri := range federatedRepoList {
|
||||
federationHost, err := GetFederationHostForUri(ctx, uri)
|
||||
|
@ -230,7 +230,7 @@ func UpdateFederatedRepoList(ctx context.Context, localRepoId int64, federatedRe
|
|||
federatedRepos = append(federatedRepos, &federatedRepo)
|
||||
}
|
||||
|
||||
repo.UpdateFederatedRepo(ctx, localRepoId, federatedRepos)
|
||||
repo.StoreFederatedRepos(ctx, localRepoId, federatedRepos)
|
||||
|
||||
return 0, "", nil
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ func SettingsPost(ctx *context.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
if _, _, err := forgefed.UpdateFederatedRepoList(ctx, ctx.Repo.Repository.ID, strings.Split(federationRepos, ";")); err != nil {
|
||||
if _, _, err := forgefed.StoreFederatedRepoList(ctx, ctx.Repo.Repository.ID, strings.Split(federationRepos, ";")); err != nil {
|
||||
ctx.ServerError("UpdateRepository", err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue