* Fix bug #49412, check model available when unpublishing a prompt.
This commit is contained in:
@@ -906,6 +906,7 @@ class ai extends control
|
||||
*/
|
||||
public function promptUnpublish($id)
|
||||
{
|
||||
if(!$this->ai->hasModelsAvailable()) return $this->send(array('result' => 'fail', 'message' => $this->lang->ai->models->noModelError, 'load' => $this->inlink('models') . '#app=admin'));
|
||||
$this->ai->togglePromptStatus($id, 'draft');
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
@@ -184,8 +184,7 @@
|
||||
{
|
||||
$.getJSON($(this).attr('href'), function(resp)
|
||||
{
|
||||
if(resp.result != 'success') $.zui.messager.danger(resp.message);
|
||||
return location.reload();
|
||||
if(resp.result != 'success') bootbox.alert(resp.message, function() {return location.reload();});
|
||||
});
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user