From 1e1f109e3434a70fa45417de48b02ab68aa52c2f Mon Sep 17 00:00:00 2001 From: qwqcode Date: Sun, 7 May 2023 18:08:26 +0800 Subject: [PATCH] fix(api): comment IP data loss after editing Signed-off-by: qwqcode --- server/handler/admin_comment_edit.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/handler/admin_comment_edit.go b/server/handler/admin_comment_edit.go index 06876a6d4..6beb647ab 100644 --- a/server/handler/admin_comment_edit.go +++ b/server/handler/admin_comment_edit.go @@ -123,8 +123,13 @@ func AdminCommentEdit(router fiber.Router) { comment.PageKey = p.PageKey } - comment.UA = p.UA - comment.IP = p.IP + if p.UA != "" { + comment.UA = p.UA + } + if p.IP != "" { + comment.IP = p.IP + } + comment.IsCollapsed = p.IsCollapsed comment.IsPinned = p.IsPinned