* webhook: refactor edit.

This commit is contained in:
sunguangming
2023-12-21 09:16:49 +08:00
parent 117fe57a17
commit a34e0fa8f9
+4 -2
View File
@@ -78,17 +78,19 @@ class webhook extends control
}
/**
* 编辑 Webhook。
* Edit a webhook.
*
* @param int $id
* @access public
* @return void
*/
public function edit($id)
public function edit(int $id)
{
if($_POST)
{
$this->webhook->update($id);
$webhook = form::data($this->config->webhook->form->edit)->get();
$this->webhook->update($id, $webhook);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => inlink('browse')));
}