Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
Add hook for org creation
David Weiricha971fd8dcb3a
diff --git a/app/server/handlers/orgs.go b/app/server/handlers/orgs.goindex 6bba3515..1c0e1fa4 100644--- a/app/server/handlers/orgs.go+++ b/app/server/handlers/orgs.go@@ -6,6 +6,7 @@ import ("log""net/http""plandex-server/db"+ "plandex-server/hooks""plandex-server/types""github.com/plandex/plandex/shared"@@ -127,6 +128,15 @@ func CreateOrgHandler(w http.ResponseWriter, r *http.Request) {}}+ err = hooks.ExecHook(hooks.CreateOrg, hooks.HookParams{+ W: w,+ User: auth.User,+ Org: org,+ })+ if err != nil {+ return+ }+err = tx.Commit()if err != nil {diff --git a/app/server/hooks/hooks.go b/app/server/hooks/hooks.goindex 74a6098b..59636383 100644--- a/app/server/hooks/hooks.go+++ b/app/server/hooks/hooks.go@@ -12,12 +12,15 @@ const (WillCreatePlan = "will_create_plan"WillTellPlan = "will_tell_plan"WillExecPlan = "will_exec_plan"++ CreateOrg = "create_org")type HookParams struct {W http.ResponseWriterUser *db.UserOrgId string+ Org *db.OrgPlan *db.PlanStreamDoneCh chan *shared.ApiError}