- $call = $this->github->createRepoHook("$owner/$repo", $hook_conf, function($hook) use($owner, $repo, &$call) {
- $call->dropFromCache();
- $this->redirectBack("$owner/$repo");
- });
- $call->send();
+ $this->github->createRepoHook("$owner/$repo", $hook_conf, function($hook) use($owner, $repo) {
+ $call = new ListHooks($this->github, ["repo" => "$owner/$repo", "fresh" => true]);
+ $call(function($hooks, $links) use($owner, $repo, $call) {
+ $call->saveToCache([$hooks, $links]);
+ $this->redirectBack("$owner/$repo");
+ });
+ })->send();