From f8db5bc01bc92b2250d9e8d031da874f7594cd68 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Wed, 27 Nov 2024 18:23:34 +0530 Subject: [PATCH] fix: not updating to status reject --- controllers/organiser.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/organiser.go b/controllers/organiser.go index d4798b9..597303a 100644 --- a/controllers/organiser.go +++ b/controllers/organiser.go @@ -97,9 +97,9 @@ func UpdateStatusProject(w http.ResponseWriter, r *http.Request) { return } - projectDetails := AcceptRejectProject{} + projectDetails := &AcceptRejectProject{} - err := utils.DecodeJSONBody(r, &projectDetails) + err := utils.DecodeJSONBody(r, projectDetails) if err != nil { utils.LogErrAndRespond(r, w, err, "Error decoding request JSON body.", http.StatusBadRequest) return @@ -108,6 +108,7 @@ func UpdateStatusProject(w http.ResponseWriter, r *http.Request) { tx := db. Table("projects"). Where("id = ?", projectDetails.Id). + Select("*"). Updates(projectDetails) if tx.Error != nil {