Skip to content

Commit

Permalink
Various bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JhumanJ committed Oct 13, 2023
1 parent 7a4b6db commit ebedaaf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Http/Requests/AiGenerateFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AiGenerateFormRequest extends FormRequest
public function rules()
{
return [
'form_prompt' => 'required|string'
'form_prompt' => 'required|string|max:1000'
];
}
}
2 changes: 1 addition & 1 deletion app/Jobs/Form/GenerateAiForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function handle()
} catch (\Exception $e) {
$this->completion->update([
'status' => AiFormCompletion::STATUS_FAILED,
'result' => $e->getMessage()
'result' => ['error' => $e->getMessage()]
]);
}

Expand Down
5 changes: 5 additions & 0 deletions app/Models/Forms/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ public function getHasPasswordAttribute()
return !empty($this->password);
}

public function getRemovedPropertiesAttribute()
{
return $this->attributes['removed_properties'] ?? [];
}

/**
* Relationships
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -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();
});
}
};

0 comments on commit ebedaaf

Please sign in to comment.