Add isUserExtended to webhook.

This commit is contained in:
Yang Luo
2022-01-01 11:15:04 +08:00
parent 4611b59b08
commit 2d4103d751
11 changed files with 104 additions and 8 deletions

View File

@ -47,6 +47,8 @@ type Record struct {
RequestUri string `xorm:"varchar(1000)" json:"requestUri"`
Action string `xorm:"varchar(1000)" json:"action"`
ExtendedUser *User `xorm:"-" json:"extendedUser"`
IsTriggered bool `json:"isTriggered"`
}
@ -159,6 +161,11 @@ func SendWebhooks(record *Record) error {
}
if matched {
if webhook.IsUserExtended {
user := getUser(record.Organization, record.User)
record.ExtendedUser = user
}
err := sendWebhook(webhook, record)
if err != nil {
return err