referrals: 1/2 generation routes, display route, partial frontend

route for generation/enabling of referral for user(s) done? the frontend
is mostly done, but functionality is not there yet. Route for finding
and displaying referral to user is done. Also the config option for
referral is there, in user page settings.
This commit is contained in:
Harvey Tindall
2023-06-28 16:05:24 +01:00
parent 423fc4ac80
commit 9c2f27bcdb
13 changed files with 320 additions and 21 deletions
+6
View File
@@ -226,6 +226,9 @@ func (app *appContext) loadRoutes(router *gin.Engine) {
api.DELETE(p+"/profiles/ombi/:profile", app.DeleteOmbiProfile)
}
api.POST(p+"/matrix/login", app.MatrixLogin)
if app.config.Section("user_page").Key("referrals").MustBool(false) {
api.POST(p+"/users/referral/:mode/:source", app.EnableReferralForUsers)
}
if userPageEnabled {
user.GET(p+"/details", app.MyDetails)
@@ -242,6 +245,9 @@ func (app *appContext) loadRoutes(router *gin.Engine) {
user.DELETE(p+"/telegram", app.UnlinkMyTelegram)
user.DELETE(p+"/matrix", app.UnlinkMyMatrix)
user.POST(p+"/password", app.ChangeMyPassword)
if app.config.Section("user_page").Key("referrals").MustBool(false) {
user.GET(p+"/referral", app.GetMyReferral)
}
}
}
}