fix(repoinfo): fix userprefs values for repos returned by expanded repo info (#1413)

- now isBookmarked and isStarred are updated correctly

Signed-off-by: Laurentiu Niculae <niculae.laurentiu1@gmail.com>
This commit is contained in:
LaurentiuNiculae
2023-05-04 19:51:21 +03:00
committed by GitHub
parent e299ae199a
commit 449f0d0ac3
11 changed files with 377 additions and 6 deletions
+10
View File
@@ -25,6 +25,8 @@ type RepoDBMock struct {
GetRepoMetaFn func(repo string) (repodb.RepoMetadata, error)
GetUserRepoMetaFn func(ctx context.Context, repo string) (repodb.RepoMetadata, error)
SetRepoMetaFn func(repo string, repoMeta repodb.RepoMetadata) error
GetMultipleRepoMetaFn func(ctx context.Context, filter func(repoMeta repodb.RepoMetadata) bool,
@@ -155,6 +157,14 @@ func (sdm RepoDBMock) GetRepoMeta(repo string) (repodb.RepoMetadata, error) {
return repodb.RepoMetadata{}, nil
}
func (sdm RepoDBMock) GetUserRepoMeta(ctx context.Context, repo string) (repodb.RepoMetadata, error) {
if sdm.GetUserRepoMetaFn != nil {
return sdm.GetUserRepoMetaFn(ctx, repo)
}
return repodb.RepoMetadata{}, nil
}
func (sdm RepoDBMock) SetRepoMeta(repo string, repoMeta repodb.RepoMetadata) error {
if sdm.SetRepoMetaFn != nil {
return sdm.SetRepoMetaFn(repo, repoMeta)