diff options
author | FChannel <> | 2022-05-07 15:11:35 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 3c5eebf6275e6d202f8a7b7f027aabcda5c1f332 (patch) | |
tree | 5fa2d82f9375ac49be357f0f8b70db06d5c97305 /routes/util.go | |
parent | 39012c6b17073f6933a5ead8beed64df555f7348 (diff) |
more organizing structs to have object functions
need to fully test to be sure nothing broke with changes
Diffstat (limited to 'routes/util.go')
-rw-r--r-- | routes/util.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/routes/util.go b/routes/util.go index ee6d062..778f52b 100644 --- a/routes/util.go +++ b/routes/util.go @@ -45,12 +45,12 @@ func wantToServePage(actorName string, page int) (activitypub.Collection, bool, } if actor.Id != "" { - collection, err = activitypub.GetObjectFromDBPage(actor.Id, page) + collection, err = actor.GetCollectionPage(page) if err != nil { return collection, false, err } - collection.Actor = &actor + collection.Actor = actor return collection, true, nil } @@ -67,12 +67,12 @@ func wantToServeCatalog(actorName string) (activitypub.Collection, bool, error) } if actor.Id != "" { - collection, err = activitypub.GetObjectFromDBCatalog(actor.Id) + collection, err = actor.GetCatalogCollection() if err != nil { return collection, false, err } - collection.Actor = &actor + collection.Actor = actor return collection, true, nil } @@ -94,7 +94,7 @@ func wantToServeArchive(actorName string) (activitypub.Collection, bool, error) return collection, false, err } - collection.Actor = &actor + collection.Actor = actor return collection, true, nil } @@ -147,7 +147,7 @@ func ParseOutboxRequest(ctx *fiber.Ctx, actor activitypub.Actor) error { nObj.Actor = config.Domain + "/" + actor.Name - nObj, err = activitypub.WriteObjectToDB(nObj) + nObj, err = nObj.Write() if err != nil { return err } |