(c *Collection, cr *collectionReq, page int)
| 830 | } |
| 831 | |
| 832 | func 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. |
no test coverage detected