Skip to content

Commit

Permalink
Merge pull request #25 from EscolaLMS/feature/STAR-440
Browse files Browse the repository at this point in the history
Feature/star 440
  • Loading branch information
KrzysztofDziedziechEscolasoft authored Mar 10, 2022
2 parents aac3177 + 17c546d commit 4611916
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface QuestionAnswerAdminApiContract
* @OA\Schema(
* type="integer",
* ),
* in="query",
* required=false
* ),
* @OA\Parameter(
Expand All @@ -38,6 +39,7 @@ interface QuestionAnswerAdminApiContract
* @OA\Schema(
* type="integer",
* ),
* in="query",
* required=false
* ),
* @OA\Response(
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Requests/QuestionnaireAssignUnassignRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Exists;

class QuestionnaireAssignUnassignRequest extends FormRequest
{
Expand Down Expand Up @@ -43,7 +44,7 @@ public function rules(): array
],
'model_id' => [
'integer',
Rule::exists($this->getQuestionnaireModelType()->model_class, 'id'),
new Exists($this->getQuestionnaireModelType()->model_class, 'id'),
],
];
}
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Requests/QuestionnaireFrontAnswerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Exists;

/**
* @OA\Schema(
Expand Down Expand Up @@ -71,7 +72,7 @@ public function rules(): array
],
'model_id' => [
'integer',
Rule::exists($this->getQuestionnaireModelType()->model_class, 'id'),
new Exists($this->getQuestionnaireModelType()->model_class, 'id'),
],
'answers' => ['sometimes', 'array'],
'answers.*' => ['sometimes', 'array'],
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Requests/QuestionnaireFrontReadRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Exists;

class QuestionnaireFrontReadRequest extends FormRequest
{
Expand Down Expand Up @@ -43,7 +44,7 @@ public function rules(): array
],
'model_id' => [
'integer',
Rule::exists($this->getQuestionnaireModelType()->model_class, 'id'),
new Exists($this->getQuestionnaireModelType()->model_class, 'id'),
],
];
}
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Requests/QuestionnaireStarsFrontRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use EscolaLms\Questionnaire\Rules\ClassExist;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Exists;

class QuestionnaireStarsFrontRequest extends FormRequest
{
Expand Down Expand Up @@ -33,7 +34,7 @@ public function rules(): array
],
'model_id' => [
'integer',
Rule::exists($this->getQuestionnaireModelType()->model_class, 'id'),
new Exists($this->getQuestionnaireModelType()->model_class, 'id'),
],
];
}
Expand Down

0 comments on commit 4611916

Please sign in to comment.