From b24c0c4ed1ba8c728e42693b6c48a660af6f558c Mon Sep 17 00:00:00 2001 From: yoneyan Date: Sat, 22 Apr 2023 15:40:25 +0900 Subject: [PATCH] [fix] Fixed #176. --- pkg/api/core/group/v0/slack.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/api/core/group/v0/slack.go b/pkg/api/core/group/v0/slack.go index fc42c0d5..c68b7f68 100644 --- a/pkg/api/core/group/v0/slack.go +++ b/pkg/api/core/group/v0/slack.go @@ -113,20 +113,18 @@ func changeTextByAdmin(before, after core.Group) string { if after.CouponID != nil { if before.CouponID == nil { data += "CouponID: None => " + *after.CouponID + "\n" - - } - if *before.CouponID != *after.CouponID { + } else if *before.CouponID != *after.CouponID { data += "CouponID: " + *before.CouponID + " => " + *after.CouponID + "\n" } } if after.MemberExpired != nil { + afterDate := after.MemberExpired.Format("2006-01-02") if before.MemberExpired == nil { - data += "MemberExpired: None => " + after.MemberExpired.Format("2006-01-02") + "\n" - - } - if *before.CouponID != *after.CouponID { - data += "MemberExpired: " + before.MemberExpired.Format("2006-01-02") + " => " + after.MemberExpired.Format("2006-01-02") + "\n" + data += "MemberExpired: None => " + afterDate + "\n" + } else if *before.MemberExpired != *after.MemberExpired { + beforeDate := before.MemberExpired.Format("2006-01-02") + data += "MemberExpired: " + beforeDate + " => " + afterDate + "\n" } }