Various bug fixes
This commit is contained in:
parent
7a4b6dbd79
commit
ebedaaf796
|
@ -14,7 +14,7 @@ class AiGenerateFormRequest extends FormRequest
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'form_prompt' => 'required|string'
|
'form_prompt' => 'required|string|max:1000'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ class GenerateAiForm implements ShouldQueue
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->completion->update([
|
$this->completion->update([
|
||||||
'status' => AiFormCompletion::STATUS_FAILED,
|
'status' => AiFormCompletion::STATUS_FAILED,
|
||||||
'result' => $e->getMessage()
|
'result' => ['error' => $e->getMessage()]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -218,6 +218,11 @@ class Form extends Model
|
||||||
return !empty($this->password);
|
return !empty($this->password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getRemovedPropertiesAttribute()
|
||||||
|
{
|
||||||
|
return $this->attributes['removed_properties'] ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relationships
|
* Relationships
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('ai_form_completions', function (Blueprint $table) {
|
||||||
|
$table->text('form_prompt')->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('ai_form_completions', function (Blueprint $table) {
|
||||||
|
$table->string('form_prompt')->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue