mirror of
https://github.com/documize/community.git
synced 2025-07-22 06:39:43 +02:00
event handlers framework
This commit is contained in:
parent
740c2ca189
commit
bcabe494e3
15 changed files with 1091 additions and 5 deletions
|
@ -28,6 +28,7 @@ import (
|
|||
"github.com/documize/community/core/log"
|
||||
"github.com/documize/community/core/utility"
|
||||
|
||||
"github.com/documize/community/core/event"
|
||||
"github.com/gorilla/mux"
|
||||
"strconv"
|
||||
)
|
||||
|
@ -174,6 +175,14 @@ func AddUser(w http.ResponseWriter, r *http.Request) {
|
|||
inviter, err := p.GetUser(p.Context.UserID)
|
||||
log.IfErr(err)
|
||||
|
||||
if addUser {
|
||||
event.Handler().Publish(string(event.TypeAddUser))
|
||||
}
|
||||
|
||||
if addAccount {
|
||||
event.Handler().Publish(string(event.TypeAddAccount))
|
||||
}
|
||||
|
||||
// Prepare invitation email (that contains SSO link)
|
||||
if addUser && addAccount {
|
||||
size := len(requestedPassword)
|
||||
|
@ -386,6 +395,8 @@ func DeleteUser(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
log.IfErr(tx.Commit())
|
||||
|
||||
event.Handler().Publish(string(event.TypeRemoveUser))
|
||||
|
||||
writeSuccessString(w, "{}")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue