Skip to content

Commit

Permalink
fix: fixed a few more things
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkhandeparkar committed Nov 18, 2023
1 parent 0005e0d commit d757717
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions controllers/mentor.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,18 @@ func CreateMentorDashboard(mentor models.Mentor, db *gorm.DB) MentorDashboard {
pulls = strings.Split(project.Pulls, ",")
}

tags := make([]string, 0)
if len(project.Tags) != 0 {
tags = strings.Split(project.Tags, ",")
}

projectInfo := ProjectInfo{
Id: project.ID,
Name: project.Name,
Description: project.Description,
RepoLink: project.RepoLink,
ReadmeLink: project.ReadmeLink,
Tags: tags,
ProjectStatus: project.ProjectStatus,

CommitCount: project.CommitCount,
Expand Down
2 changes: 1 addition & 1 deletion controllers/project_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func newMentor(dbMentor *models.Mentor) Mentor {
}
func newProject(dbProject *models.Project) Project {
tags := make([]string, 0)
if len(tags) != 0 {
if len(dbProject.Tags) != 0 {
tags = strings.Split(dbProject.Tags, ",")
}

Expand Down

0 comments on commit d757717

Please sign in to comment.