mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
webhooks: add "user created" webhook
Webhooks send a POST to an admin-supplied URL when something happens, with relevant information sent in JSON. One has been added for creating users in Settings > Webhooks > User Created. Lazily, the portion of GetUsers which generates a respUser has been factored out, and is called to send the JSON payload. A stripped-down common.Req method has been added, which is used by the barebones WebhookSender struct.
This commit is contained in:
2
api.go
2
api.go
@@ -354,6 +354,8 @@ func (app *appContext) ModifyConfig(gc *gin.Context) {
|
||||
tempConfig.Section("telegram").Key("language").SetValue(value.(string))
|
||||
} else if app.configBase.Sections[section].Settings[setting].Type == "list" {
|
||||
splitValues := strings.Split(value.(string), "|")
|
||||
// Delete the key first to get rid of any shadow values
|
||||
tempConfig.Section(section).DeleteKey(setting)
|
||||
for i, v := range splitValues {
|
||||
if i == 0 {
|
||||
tempConfig.Section(section).Key(setting).SetValue(v)
|
||||
|
||||
Reference in New Issue
Block a user