Skip to content

Commit

Permalink
fix: i also hate postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkhandeparkar committed Nov 18, 2023
1 parent 3cd5fdb commit 96c746c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions controllers/project_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,19 @@ func UpdateProject(w http.ResponseWriter, r *http.Request) {
}
}

secondaryMentorId := int32(secondaryMentor.ID)
updatedProj := &models.Project{
Name: reqFields.Name,
Description: reqFields.Description,
Tags: strings.Join(reqFields.Tags, ","),
RepoLink: reqFields.RepoLink,
CommChannel: reqFields.CommChannel,
ReadmeLink: reqFields.ReadmeLink,
SecondaryMentorId: &secondaryMentorId,
Name: reqFields.Name,
Description: reqFields.Description,
Tags: strings.Join(reqFields.Tags, ","),
RepoLink: reqFields.RepoLink,
CommChannel: reqFields.CommChannel,
ReadmeLink: reqFields.ReadmeLink,
SecondaryMentor: secondaryMentor,
}

tx = db.
Table("projects").
Where("id = ?", reqFields.Id).
Select("name", "description", "tags", "repo_link", "comm_channel", "readme_link", "secondary_mentor_id").
Updates(updatedProj)

if tx.Error != nil {
Expand Down

0 comments on commit 96c746c

Please sign in to comment.