MCPcopy
hub / github.com/writefreely/writefreely / newDisplayCollection

Function newDisplayCollection

collections.go:832–844  ·  view source on GitHub ↗
(c *Collection, cr *collectionReq, page int)

Source from the content-addressed store, hash-verified

830}
831
832func newDisplayCollection(c *Collection, cr *collectionReq, page int) (*DisplayCollection, error) {
833 coll := &DisplayCollection{
834 CollectionObj: NewCollectionObj(c),
835 CurrentPage: page,
836 Prefix: cr.prefix,
837 IsTopLevel: isSingleUser,
838 }
839 err := c.db.GetPostsCount(coll.CollectionObj, cr.isCollOwner)
840 if err != nil {
841 return nil, err
842 }
843 return coll, nil
844}
845
846// getCollectionPage returns the collection page as an int. If the parsed page value is not
847// greater than 0 then the default value of 1 is returned.

Callers 3

handleViewCollectionFunction · 0.85
handleViewCollectionTagFunction · 0.85
handleViewCollectionLangFunction · 0.85

Calls 2

NewCollectionObjFunction · 0.85
GetPostsCountMethod · 0.65

Tested by

no test coverage detected