Skip to content

Commit 04e2032

Browse files
committed
fix api eliminazione lista
1 parent 7a839df commit 04e2032

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Endpoints/RulesLists.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function deleteList(string $accountId, string $listId)
7676
$response = $this->adapter->delete('accounts/' . $accountId . '/rules/lists/' . $listId);
7777
$this->body = json_decode($response->getBody());
7878

79-
return $this->body;
79+
return $this->body->result;
8080
}
8181

8282
public function createListItem(string $accountId, string $listId, array $ip)

tests/Endpoints/RulesListsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public function testDeleteRulesList()
5252
$rulesLists = new \Cloudflare\API\Endpoints\RulesLists($mock);
5353
$result = $rulesLists->deleteList('01a7362d577a6c3019a474fd6f485823', '2c0fc9fa937b11eaa1b71c4d701ab86e');
5454

55-
$this->assertEquals(true, $result->success);
56-
$this->assertEquals(true, $rulesLists->getBody()->success);
55+
$this->assertEquals('2c0fc9fa937b11eaa1b71c4d701ab86e', $result->id);
56+
$this->assertEquals('2c0fc9fa937b11eaa1b71c4d701ab86e', $rulesLists->getBody()->result->id);
5757
}
5858

5959
public function testGetRulesLists()

tests/Fixtures/Endpoints/deleteRulesList.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"result": {
15-
"id": "34b12448945f11eaa1b71c4d701ab86e"
15+
"id": "2c0fc9fa937b11eaa1b71c4d701ab86e"
1616
},
1717
"success": true
1818
}

0 commit comments

Comments
 (0)