From 96c746c6fff1cfdf41e39b3f7b3ec17acc269ff8 Mon Sep 17 00:00:00 2001 From: Harsh Khandeparkar Date: Sat, 18 Nov 2023 15:29:52 +0530 Subject: [PATCH] fix: i also hate postgres --- controllers/project_update.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/controllers/project_update.go b/controllers/project_update.go index d063b75..8820f07 100644 --- a/controllers/project_update.go +++ b/controllers/project_update.go @@ -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 {