initial completion

This commit is contained in:
2026-05-07 15:51:38 +02:00
parent f211cfc7db
commit 3b1368e16d
36 changed files with 1576 additions and 6 deletions
+12 -2
View File
@@ -46,8 +46,9 @@ func New(cfg *config.Config, engine *xorm.Engine, store sessions.Store, staticFi
memberH := handlers.NewMemberHandler(engine)
keyH := handlers.NewDeployKeyHandler(engine)
tokenH := handlers.NewAccessTokenHandler(engine)
workflowH := handlers.NewWorkflowHandler(engine)
webhookH := handlers.NewWebhookHandler(engine)
workflowH := handlers.NewWorkflowHandler(engine)
webhookH := handlers.NewWebhookHandler(engine)
prSettingsH := handlers.NewPRSettingsHandler(engine)
// ── Git smart-HTTP transport ───────────────────────────────────────────────
// These routes MUST be registered before the SPA catch-all and outside CSRF.
@@ -172,6 +173,15 @@ func New(cfg *config.Config, engine *xorm.Engine, store sessions.Store, staticFi
r.With(csrf).Delete("/{whID}", webhookH.Delete)
r.With(csrf).Post("/{whID}/test", webhookH.Test)
})
r.Route("/default-reviewers", func(r chi.Router) {
r.Get("/", prSettingsH.ListDefaultReviewers)
r.With(csrf).Post("/", prSettingsH.AddDefaultReviewer)
r.With(csrf).Delete("/{username}", prSettingsH.RemoveDefaultReviewer)
})
r.Get("/default-description", prSettingsH.GetDefaultDescription)
r.With(csrf).Put("/default-description", prSettingsH.UpdateDefaultDescription)
r.Get("/excluded-files", prSettingsH.GetExcludedFiles)
r.With(csrf).Put("/excluded-files", prSettingsH.UpdateExcludedFiles)
})
})
})