Sushi to dynamically load data from API using search keyword

Hello,
I am using Sushi to load a data into a table with API data using a search keyword.
But I am missing something here as I am not able to load the data from API after the search but if I provide the search term initially then it loads the proper data to the table.

Please check my code and help me fix this, thank you so much.

This is my custom page code, removed the imports due to limitations.
<?php

namespace App\Filament\Dashboard\Pages;

class TargetFinderGenerator extends Page implements HasForms, HasTable
{

    use InteractsWithTable, InteractsWithForms;

    public $keyword;
    public $selected = [];

    protected static ?string $navigationIcon = 'heroicon-o-arrow-right-end-on-rectangle';

    protected static ?string $navigationGroup = 'Target Finder';

    protected static string $view = 'filament.dashboard.pages.target-finder-generator';


    public ?array $data = [];



    public function form(Form $form): Form
    {
        return $form
            ->statePath('data')
            ->schema([
                Grid::make(2)
                    ->schema([
                        TextInput::make("keyword")
                            ->default(2)
                            ->required(),
                    ])

            ]);
    }

    public static function table(Table $table): Table
    {
        return $table
            ->columns([
                TextColumn::make("name"),
                TextColumn::make("email"),
                TextColumn::make("body"),
            ])
            ->filters([])
            ->actions([])
            ->bulkActions([])
            ->query(TargetFinder::query());
    }


    public function fetchApiData()
    {
        $this->selected = [];
        (new TargetFinder)->getRows($this->data);
    }
}

Thank you
Was this page helpful?