Skip to content

Commit

Permalink
fix: makeOwner endpoints notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrckd committed Jun 17, 2024
1 parent 4d6221b commit e8da644
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion graph/user_op.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func LeaveRole(uctx *model.UserCtx, tension *model.Tension, node *model.NodeFrag
}
// If owner is alone, prevent orphan organization
if len(owners) < 2 {
return false, LogErr("access denied", fmt.Errorf("An organization need at least one Owner. Please contact us if you need to transfer ownership."))
return false, LogErr("access denied", fmt.Errorf("An organization needs at least one Owner. Please contact us if you need to transfer ownership."))
}

// Downgrade Owner to Member
Expand Down
2 changes: 1 addition & 1 deletion web/email/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func SendOwnerGrantedEmail(username, nameid, orgName string) error {
"to": ["%s"],
"subject": "Ownership of %s was granted",
"html_body": "%s"
}`, email, tools.CleanString(content, true))
}`, email, orgName, tools.CleanString(content, true))

req, err := http.NewRequest("POST", emailUrl, bytes.NewBuffer([]byte(body)))
req.Header.Set("Content-Type", "application/json")
Expand Down
2 changes: 1 addition & 1 deletion web/handlers/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func MakeOwner(w http.ResponseWriter, r *http.Request) {
} else {
orgName = x.(string)
}
if x, err := db.GetDB().GetSubSubFieldByEq("Node.nameid", "f6", "Node.source", "Blob.tension", "uid"); err != nil {
if x, err := db.GetDB().GetSubSubFieldByEq("Node.nameid", form.Nameid, "Node.source", "Blob.tension", "uid"); err != nil {
http.Error(w, err.Error(), 500)
return
} else {
Expand Down

0 comments on commit e8da644

Please sign in to comment.