From 1892327cee2c3fa1d3bea729bd08eb63c2189a96 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sat, 30 Apr 2022 11:00:55 -0700 Subject: restructured code base to prevent circular dependicies --- routes/news.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'routes/news.go') diff --git a/routes/news.go b/routes/news.go index 98d0019..2a8a0f9 100644 --- a/routes/news.go +++ b/routes/news.go @@ -1,8 +1,10 @@ package routes import ( + "github.com/FChannel0/FChannel-Server/activitypub" "github.com/FChannel0/FChannel-Server/config" "github.com/FChannel0/FChannel-Server/db" + "github.com/FChannel0/FChannel-Server/webfinger" "github.com/gofiber/fiber/v2" ) @@ -10,14 +12,14 @@ func NewsGet(ctx *fiber.Ctx) error { // TODO timestamp := 0 - actor, err := db.GetActorFromDB(config.Domain) + actor, err := activitypub.GetActorFromDB(config.Domain) if err != nil { return err } var data PageData data.PreferredUsername = actor.PreferredUsername - data.Boards = db.Boards + data.Boards = webfinger.Boards data.Board.Name = "" data.Key = config.Key data.Board.Domain = config.Domain @@ -41,7 +43,7 @@ func NewsGet(ctx *fiber.Ctx) error { } func AllNewsGet(ctx *fiber.Ctx) error { - actor, err := db.GetActorFromDB(config.Domain) + actor, err := activitypub.GetActorFromDB(config.Domain) if err != nil { return err } @@ -49,7 +51,7 @@ func AllNewsGet(ctx *fiber.Ctx) error { var data PageData data.PreferredUsername = actor.PreferredUsername data.Title = actor.PreferredUsername + " News" - data.Boards = db.Boards + data.Boards = webfinger.Boards data.Board.Name = "" data.Key = config.Key data.Board.Domain = config.Domain -- cgit v1.2.3