(app *App, u *User)
| 101 | } |
| 102 | |
| 103 | func compileFullExport(app *App, u *User) *ExportUser { |
| 104 | exportUser := &ExportUser{ |
| 105 | User: u, |
| 106 | } |
| 107 | |
| 108 | colls, err := app.db.GetCollections(u, app.cfg.App.Host) |
| 109 | if err != nil { |
| 110 | log.Error("unable to fetch collections: %v", err) |
| 111 | } |
| 112 | |
| 113 | posts, err := app.db.GetAnonymousPosts(u, 0) |
| 114 | if err != nil { |
| 115 | log.Error("unable to fetch anon posts: %v", err) |
| 116 | } |
| 117 | exportUser.AnonymousPosts = *posts |
| 118 | |
| 119 | var collObjs []CollectionObj |
| 120 | for _, c := range *colls { |
| 121 | co := &CollectionObj{Collection: c} |
| 122 | co.Posts, err = app.db.GetPosts(app.cfg, &c, 0, true, false, true, "") |
| 123 | if err != nil { |
| 124 | log.Error("unable to get collection posts: %v", err) |
| 125 | } |
| 126 | app.db.GetPostsCount(co, true) |
| 127 | collObjs = append(collObjs, *co) |
| 128 | } |
| 129 | exportUser.Collections = &collObjs |
| 130 | |
| 131 | return exportUser |
| 132 | } |
no test coverage detected