From 0e4c0e5017e593fd644dc81c1e74c2876a51c2a2 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 22 Dec 2024 23:25:25 +0800 Subject: [PATCH] :bug: Bug fixes on editing post --- pkg/internal/http/api/articles_api.go | 6 ++++-- pkg/internal/http/api/stories_api.go | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pkg/internal/http/api/articles_api.go b/pkg/internal/http/api/articles_api.go index 02fd12f..8beab65 100644 --- a/pkg/internal/http/api/articles_api.go +++ b/pkg/internal/http/api/articles_api.go @@ -1,12 +1,13 @@ package api import ( + "strconv" + "time" + "git.solsynth.dev/hypernet/nexus/pkg/nex/cruda" "git.solsynth.dev/hypernet/nexus/pkg/nex/sec" "git.solsynth.dev/hypernet/passport/pkg/authkit" authm "git.solsynth.dev/hypernet/passport/pkg/authkit/models" - "strconv" - "time" "git.solsynth.dev/hypernet/interactive/pkg/internal/database" "git.solsynth.dev/hypernet/interactive/pkg/internal/gap" @@ -178,6 +179,7 @@ func editArticle(c *fiber.Ctx) error { item.Categories = data.Categories item.IsDraft = data.IsDraft item.PublishedUntil = data.PublishedUntil + item.PublishedAt = data.PublishedAt item.VisibleUsers = data.VisibleUsers item.InvisibleUsers = data.InvisibleUsers diff --git a/pkg/internal/http/api/stories_api.go b/pkg/internal/http/api/stories_api.go index cd1bedb..a873f2f 100644 --- a/pkg/internal/http/api/stories_api.go +++ b/pkg/internal/http/api/stories_api.go @@ -2,12 +2,13 @@ package api import ( "fmt" + "strconv" + "time" + "git.solsynth.dev/hypernet/nexus/pkg/nex/cruda" "git.solsynth.dev/hypernet/nexus/pkg/nex/sec" "git.solsynth.dev/hypernet/passport/pkg/authkit" authm "git.solsynth.dev/hypernet/passport/pkg/authkit/models" - "strconv" - "time" "git.solsynth.dev/hypernet/interactive/pkg/internal/database" "git.solsynth.dev/hypernet/interactive/pkg/internal/gap" @@ -200,8 +201,9 @@ func editStory(c *fiber.Ctx) error { item.Language = services.DetectLanguage(data.Content) item.Tags = data.Tags item.Categories = data.Categories - item.PublishedUntil = data.PublishedUntil item.IsDraft = data.IsDraft + item.PublishedAt = data.PublishedAt + item.PublishedUntil = data.PublishedUntil item.VisibleUsers = data.VisibleUsers item.InvisibleUsers = data.InvisibleUsers