userpage: show and allow modification of contact methods

This commit is contained in:
Harvey Tindall
2023-06-17 17:26:36 +01:00
parent 3e034c85d6
commit a22f032924
43 changed files with 422 additions and 149 deletions

View File

@@ -336,6 +336,10 @@ func (app *appContext) SetContactMethods(gc *gin.Context) {
respondBool(400, false, gc)
return
}
app.setContactMethods(req, gc)
}
func (app *appContext) setContactMethods(req SetContactMethodsDTO, gc *gin.Context) {
if tgUser, ok := app.storage.telegram[req.ID]; ok {
change := tgUser.Contact != req.Telegram
tgUser.Contact = req.Telegram