Skip to content

Commit

Permalink
Syntax update
Browse files Browse the repository at this point in the history
  • Loading branch information
olekjs committed Apr 19, 2024
1 parent 6380f5c commit 9ccc158
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Alias/Alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function remove(string $index, string $alias): bool

public function runActions(array $actions): Response
{
$response = $this->client->getBaseClient()->post('_aliases', $actions);
$response = $this->client->getBaseClient()->post('_aliases', ['actions' => $actions]);

if ($response->clientError()) {
$this->client->throwUpdateResponseException(
Expand All @@ -93,14 +93,14 @@ public function replace(string $alias, string $newIndex, ?string $oldIndex = nul
$response = $this->runActions([
[
'add' => [
'index' => $alias,
'alias' => $newIndex,
'index' => $newIndex,
'alias' => $alias,
]
],
[
'remove' => [
'index' => $alias,
'alias' => $oldIndex,
'index' => $oldIndex,
'alias' => $alias,
]
]
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Index/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(private readonly ClientInterface $client = new Clien
*/
public function create(string $name, array $settings = []): bool
{
$response = $this->client->getBaseClient()->put($name, $settings);
$response = $this->client->getBaseClient()->put($name, (object) $settings);

if ($response->clientError()) {
$this->client->throwUpdateResponseException(
Expand Down

0 comments on commit 9ccc158

Please sign in to comment.