Skip to content

Commit

Permalink
fix: not updating to status reject
Browse files Browse the repository at this point in the history
  • Loading branch information
Bikram-ghuku committed Nov 27, 2024
1 parent 62c4a0f commit f8db5bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/organiser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit f8db5bc

Please sign in to comment.