flush
[pharext/pharext.org] / app / Controller / Github / Repo / Hook.php
index 1ef33a37cb921cae11284f1c8d95a5c2910a8d8b..fac64502fa58d64fa9dafa8656ac79377b30cd68 100644 (file)
@@ -15,6 +15,10 @@ class Hook extends Github
                                        "query" => "modal=hook&hook=" . $args["action"]
                                ]));
                        } else switch ($args["action"]) {
+                               case "upd":
+                                       $this->updateHook($args["owner"], $args["name"]);
+                                       break;
+                               
                                case "add":
                                        $this->addHook($args["owner"], $args["name"]);
                                        break;
@@ -27,7 +31,8 @@ class Hook extends Github
        }
        
        function addHook($owner, $repo) {
-               $this->github->createRepoHook("$owner/$repo", function($hook) use($owner, $repo) {
+               $hook_conf = $this->app->getRequest()->getForm();
+               $this->github->createRepoHook("$owner/$repo", $hook_conf, function($hook) use($owner, $repo) {
                        if (($cache = $this->github->getCacheStorage())) {
                                $cache->del($this->github->getCacheKey("hooks:$owner/$repo"));
                        }