diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-12-23 16:37:44 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-23 16:37:44 +0300 |
| commit | 741b694f303db6d60d49241d89e352475ffdf616 (patch) | |
| tree | 4fae49e3e717e7585bf8f044a048c01b679fe0b1 /backend | |
| parent | feat: discussion page (#137) (diff) | |
| download | lphub-741b694f303db6d60d49241d89e352475ffdf616.tar.gz lphub-741b694f303db6d60d49241d89e352475ffdf616.tar.bz2 lphub-741b694f303db6d60d49241d89e352475ffdf616.zip | |
feat: update post on new comment (#59)
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/handlers/discussions.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/backend/handlers/discussions.go b/backend/handlers/discussions.go index 39c9904..0fc0c11 100644 --- a/backend/handlers/discussions.go +++ b/backend/handlers/discussions.go | |||
| @@ -222,6 +222,12 @@ func CreateMapDiscussionComment(c *gin.Context) { | |||
| 222 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) | 222 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) |
| 223 | return | 223 | return |
| 224 | } | 224 | } |
| 225 | sql = `UPDATE map_discussions SET updated_at = $2 WHERE id = $1` | ||
| 226 | _, err = database.DB.Exec(sql, discussionID, time.Now().UTC()) | ||
| 227 | if err != nil { | ||
| 228 | c.JSON(http.StatusOK, models.ErrorResponse(err.Error())) | ||
| 229 | return | ||
| 230 | } | ||
| 225 | c.JSON(http.StatusOK, models.Response{ | 231 | c.JSON(http.StatusOK, models.Response{ |
| 226 | Success: true, | 232 | Success: true, |
| 227 | Message: "Successfully created map discussion comment.", | 233 | Message: "Successfully created map discussion comment.", |