Skip to content

Commit ecb1fbe

Browse files
authored
Merge pull request #684 from ghanbari/patch-1
name field is not defined in offer
2 parents 05cb82f + a4bd0df commit ecb1fbe

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/filters.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
154154
155155
/**
156156
* @ApiResource()
157-
* @ApiFilter(SearchFilter::class, properties={"id": "exact", "price": "exact", "name": "partial"})
157+
* @ApiFilter(SearchFilter::class, properties={"id": "exact", "price": "exact", "description": "partial"})
158158
*/
159159
class Offer
160160
{
@@ -163,10 +163,9 @@ class Offer
163163
```
164164

165165
`http://localhost:8000/api/offers?price=10` will return all offers with a price being exactly `10`.
166-
`http://localhost:8000/api/offers?name=shirt` will return all offers with a description containing the word "shirt".
167-
`http://localhost:8000/api/offers?name[]=shirt&name[]=sweat` will return all offers with a description containing the word "shirt" or containing the word "sweat".
166+
`http://localhost:8000/api/offers?description=shirt` will return all offers with a description containing the word "shirt".
168167

169-
Filters can be combined together: `http://localhost:8000/api/offers?price=10&name=shirt`
168+
Filters can be combined together: `http://localhost:8000/api/offers?price=10&description=shirt`
170169

171170
It is possible to filter on relations too, if `Offer` has a `Product` relation:
172171

0 commit comments

Comments
 (0)