* Fix bug #49412, check model available when unpublishing a prompt.

This commit is contained in:
liumengyi
2024-05-14 14:06:22 +08:00
parent 7b1473fbde
commit 8ddf12fa93
2 changed files with 2 additions and 2 deletions
+1
View File
@@ -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()));
+1 -2
View File
@@ -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;