Skip to content

Commit 10ab2d5

Browse files
josip-miloticJosip MilotićStyleCIBot
authored
Remote cf validation (#81)
* Fixed validation for remote types * Apply fixes from StyleCI Co-authored-by: Josip Milotić <[email protected]> Co-authored-by: StyleCI Bot <[email protected]>
1 parent 1efbdef commit 10ab2d5

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

src/App/Http/Requests/RemoteCustomFieldRequest.php

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,22 @@ public function authorize()
2626
public function rules()
2727
{
2828
return [
29-
'name' => 'required|string|regex:/^[^\s]*$/i|unique:custom_fields,name' . ($this->custom_field ? ',' . $this->custom_field->id : null),
30-
'label' => 'required|string|max:255',
31-
'placeholder' => 'nullable|string',
32-
'model' => 'required|string',
33-
'required' => 'boolean',
34-
'validation_id' => 'nullable|exists:custom_field_validations',
35-
'group' => 'nullable|string',
36-
'order' => 'nullable|integer',
37-
'remote' => 'required|array',
38-
'remote.url' => 'required|url',
39-
'remote.method' => 'required|in:GET,POST,PUT',
40-
'remote.body' => 'nullable|array',
41-
'remote.headers' => 'nullable|array',
42-
'remote.mappings' => 'nullable|array',
29+
'name' => 'required|string|regex:/^[^\s]*$/i|unique:custom_fields,name' . ($this->custom_field ? ',' . $this->custom_field->id : null),
30+
'label' => 'required|string|max:255',
31+
'placeholder' => 'nullable|string',
32+
'model' => 'required|string',
33+
'required' => 'boolean',
34+
'validation_id' => 'nullable|exists:custom_field_validations',
35+
'group' => 'nullable|string',
36+
'order' => 'nullable|integer',
37+
'remote' => 'required|array',
38+
'remote.url' => 'required|url',
39+
'remote.method' => 'required|in:GET,POST,PUT',
40+
'remote.body' => 'nullable|array',
41+
'remote.headers' => 'nullable|array',
42+
'remote.mappings' => 'nullable|array',
43+
'remote.data_path' => 'nullable|string',
44+
'remote.identifier_property' => 'nullable|string',
4345
];
4446
}
4547

src/App/Http/Requests/RemoteTypeRequest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ public function authorize()
2626
public function rules()
2727
{
2828
return [
29-
'url' => 'url',
30-
'method' => 'in:GET,POST,PUT',
31-
'body' => 'nullable|array',
32-
'headers' => 'nullable|array',
33-
'mappings' => 'nullable|array',
29+
'url' => 'url',
30+
'method' => 'in:GET,POST,PUT',
31+
'body' => 'nullable|array',
32+
'headers' => 'nullable|array',
33+
'mappings' => 'nullable|array',
34+
'data_path' => 'nullable|string',
35+
'identifier_property' => 'nullable|string',
3436
];
3537
}
3638
}

0 commit comments

Comments
 (0)