From 67dfeb2b5010b2971bb4ded5d98925406a15f18e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 29 Feb 2024 10:34:23 +0800 Subject: [PATCH] Ignore the fields on database when it's empty --- models/issues/comment.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/issues/comment.go b/models/issues/comment.go index fafc2673c3..48b8e335d4 100644 --- a/models/issues/comment.go +++ b/models/issues/comment.go @@ -224,9 +224,9 @@ func (r RoleInRepo) LocaleHelper(lang translation.Locale) string { // CommentMetaData stores metadata for a comment, these data will not be changed once inserted into database type CommentMetaData struct { - ProjectColumnID int64 `json:"project_column_id"` - ProjectColumnTitle string `json:"project_column_title"` - ProjectTitle string `json:"project_title"` + ProjectColumnID int64 `json:"project_column_id,omitempty"` + ProjectColumnTitle string `json:"project_column_title,omitempty"` + ProjectTitle string `json:"project_title,omitempty"` } // Comment represents a comment in commit and issue page.