fix: ignore errors when loading data for converting project to response

This commit is contained in:
dineshsalunke
2024-01-17 22:55:07 +05:30
parent 33c5722776
commit f34c05259d

View File

@@ -46,7 +46,7 @@ func ToAPIProject(ctx context.Context, project *project_model.Project) *api.Proj
} }
// try to laod the repo // try to laod the repo
project.LoadRepo(ctx) _ = project.LoadRepo(ctx)
if project.Repo != nil { if project.Repo != nil {
apiProject.Repo = &api.RepositoryMeta{ apiProject.Repo = &api.RepositoryMeta{
ID: project.RepoID, ID: project.RepoID,
@@ -56,7 +56,7 @@ func ToAPIProject(ctx context.Context, project *project_model.Project) *api.Proj
} }
} }
project.LoadCreator(ctx) _ = project.LoadCreator(ctx)
if project.Creator != nil { if project.Creator != nil {
apiProject.Creator = &api.User{ apiProject.Creator = &api.User{
ID: project.Creator.ID, ID: project.Creator.ID,
@@ -65,7 +65,7 @@ func ToAPIProject(ctx context.Context, project *project_model.Project) *api.Proj
} }
} }
project.LoadOwner(ctx) _ = project.LoadOwner(ctx)
if project.Owner != nil { if project.Owner != nil {
apiProject.Owner = &api.User{ apiProject.Owner = &api.User{
ID: project.Owner.ID, ID: project.Owner.ID,