forked from tangled.org/core
this repo has no description

appview: pulls: supply posthog client to PullsRouter

if the client is nil, posthog fails to enqueue a request, it crashes the
route and prevents redirect (as seen while creating pull comments and
pull requests)

Signed-off-by: oppiliappan <me@oppi.li>

authored by oppi.li and committed by Tangled a3f005f8 0e596b62

Changed files
+3 -1
appview
pulls
state
+2
appview/pulls/pulls.go
··· 51 resolver *idresolver.Resolver, 52 db *db.DB, 53 config *config.Config, 54 ) *Pulls { 55 return &Pulls{ 56 oauth: oauth, ··· 59 idResolver: resolver, 60 db: db, 61 config: config, 62 } 63 } 64
··· 51 resolver *idresolver.Resolver, 52 db *db.DB, 53 config *config.Config, 54 + posthog posthog.Client, 55 ) *Pulls { 56 return &Pulls{ 57 oauth: oauth, ··· 60 idResolver: resolver, 61 db: db, 62 config: config, 63 + posthog: posthog, 64 } 65 } 66
+1 -1
appview/state/router.go
··· 178 } 179 180 func (s *State) PullsRouter(mw *middleware.Middleware) http.Handler { 181 - pulls := pulls.New(s.oauth, s.repoResolver, s.pages, s.idResolver, s.db, s.config) 182 return pulls.Router(mw) 183 } 184
··· 178 } 179 180 func (s *State) PullsRouter(mw *middleware.Middleware) http.Handler { 181 + pulls := pulls.New(s.oauth, s.repoResolver, s.pages, s.idResolver, s.db, s.config, s.posthog) 182 return pulls.Router(mw) 183 } 184