You are here

public function SavedSearchCreateForm::saveFormAjax in Search API Saved Searches 8

Handles an AJAX submit of the form.

Parameters

array $form: The current form array.

\Drupal\Core\Form\FormStateInterface $form_state: The current form state.

Return value

array The part of the form to return as AJAX.

File

src/Form/SavedSearchCreateForm.php, line 61

Class

SavedSearchCreateForm
Provides a form for saving a search.

Namespace

Drupal\search_api_saved_searches\Form

Code

public function saveFormAjax(array $form, FormStateInterface $form_state) {
  return $form_state
    ->getErrors() ? $form : [
    '#type' => 'status_messages',
  ];
}