Skip to content

Commit

Permalink
add search for apps
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Oct 25, 2024
1 parent d1ecfae commit b938c83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/Console/Commands/Publish.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ public function handle()
[
'name' => 'type',
'contents' => 'apps'
],
[
'name' => 'token',
'contents' => config('Apps.token')
]
]
]);
Expand Down
11 changes: 4 additions & 7 deletions src/Console/Commands/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class Search extends CommandInterface
{
protected $signature = 'apps:search {name}';
protected $signature = 'app:search {name}';

protected $description = 'list an app';

Expand All @@ -25,15 +25,12 @@ public function handle()
return false;
}

$client = new Client([
'timeout' => 20.0,
'debug' => false,
]);
$client = $this->setClient();

$base_url = config("apps.url")."/api/Apps/list/search/".$name;
$base_url = config("apps.url")."".$name;
$this->info("Base URL: ".$base_url);

$response = $client->get($base_url, [
$response = $client->get('/api/v1/app/search/', [
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
Expand Down
1 change: 1 addition & 0 deletions src/Providers/AppsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ protected function registerCommands(): void
\NexaMerchant\Apps\Console\Commands\Remove::class,
\NexaMerchant\Apps\Console\Commands\Lists::class, // apps:lists
\NexaMerchant\Apps\Console\Commands\Publish::class, // apps:publish
\NexaMerchant\Apps\Console\Commands\Search::class, // app:search
]);
}
}
Expand Down

0 comments on commit b938c83

Please sign in to comment.