Skip to content

Commit 31c4ee3

Browse files
committedJan 28, 2024
Upgrade List function with query param
1 parent a19383b commit 31c4ee3

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed
 

‎README.md

+26-6
Original file line numberDiff line numberDiff line change
@@ -443,17 +443,17 @@ List invoices:
443443
```php
444444
BillingoApi::api('Document')->list([
445445
'page' => 1,
446-
'page' => 25,
446+
'per_page' => 25,
447447
'block_id' => 42432,
448448
'partner_id' => 13123123,
449449
'payment_method' => 'cash',
450450
'payment_status' => 'paid',
451-
'start_date'] => '2020-05-10',
451+
'start_date' => '2020-05-10',
452452
'end_date' => '2020-05-15',
453453
'start_number' => '1',
454454
'end_number' => '10',
455455
'start_year' => 2020,
456-
'end_year'] => 2020
456+
'end_year' => 2020
457457
])->getResponse();
458458
```
459459

@@ -466,6 +466,16 @@ BillingoApi::api('Partner')->list([
466466
])->getResponse();
467467
```
468468

469+
List partners with query string:
470+
471+
```php
472+
BillingoApi::api('Partner')->list([
473+
'page' => 1,
474+
'per_page' => 5,
475+
'query' => 'Teszt partner'
476+
])->getResponse();
477+
```
478+
469479
List blocks:
470480

471481
```php
@@ -500,17 +510,17 @@ List invoices:
500510
```php
501511
$billingoApi->api('Document')->list([
502512
'page' => 1,
503-
'page' => 25,
513+
'per_page' => 25,
504514
'block_id' => 42432,
505515
'partner_id' => 13123123,
506516
'payment_method' => 'cash',
507517
'payment_status' => 'paid',
508-
'start_date'] => '2020-05-10',
518+
'start_date' => '2020-05-10',
509519
'end_date' => '2020-05-15',
510520
'start_number' => '1',
511521
'end_number' => '10',
512522
'start_year' => 2020,
513-
'end_year'] => 2020
523+
'end_year' => 2020
514524
])->getResponse();
515525
```
516526

@@ -523,6 +533,16 @@ $billingoApi->api('Partner')->list([
523533
])->getResponse();
524534
```
525535

536+
List partners with query string:
537+
538+
```php
539+
$billingoApi->api('Partner')->list([
540+
'page' => 1,
541+
'per_page' => 5,
542+
'query' => 'Teszt partner'
543+
])->getResponse();
544+
```
545+
526546
List blocks:
527547

528548
```php

‎src/BillingoApiV3Wrapper.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ public function list(array $conditions): self
191191
$conditions['start_number'] ?? null,
192192
$conditions['end_number'] ?? null,
193193
$conditions['start_year'] ?? null,
194-
$conditions['end_year'] ?? null
194+
$conditions['end_year'] ?? null,
195+
$conditions['query'] ?? null
195196
],
196197
true
197198
);

0 commit comments

Comments
 (0)