1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-01-22 13:43:04 +02:00

replaced QueryString() with QueryParams().Encode()

This commit is contained in:
Gani Georgiev 2022-12-08 13:35:56 +02:00
parent 7aefcd9bf6
commit 9cf5e28700
5 changed files with 6 additions and 4 deletions

View File

@ -4,6 +4,8 @@
- Added `Dao` query semaphore and base fail/retry handling to improve the concurrent writes throughput ([#1187](https://github.com/pocketbase/pocketbase/issues/1187)).
- Replaced `c.QueryString()` with `c.QueryParams().Encode()` to allow loading middleware modified query parameters in the default crud actions ([#1210](https://github.com/pocketbase/pocketbase/discussions/1210)).
- Updated the GitHub goreleaser action to use go 1.19.4 since it comes with [some security fixes](https://github.com/golang/go/issues?q=milestone%3AGo1.19.4+label%3ACherryPickApproved).

View File

@ -120,7 +120,7 @@ func (api *adminApi) list(c echo.Context) error {
result, err := search.NewProvider(fieldResolver).
Query(api.app.Dao().AdminQuery()).
ParseAndExec(c.QueryString(), &admins)
ParseAndExec(c.QueryParams().Encode(), &admins)
if err != nil {
return NewBadRequestError("", err)

View File

@ -36,7 +36,7 @@ func (api *collectionApi) list(c echo.Context) error {
result, err := search.NewProvider(fieldResolver).
Query(api.app.Dao().CollectionQuery()).
ParseAndExec(c.QueryString(), &collections)
ParseAndExec(c.QueryParams().Encode(), &collections)
if err != nil {
return NewBadRequestError("", err)

View File

@ -35,7 +35,7 @@ func (api *logsApi) requestsList(c echo.Context) error {
result, err := search.NewProvider(fieldResolver).
Query(api.app.LogsDao().RequestQuery()).
ParseAndExec(c.QueryString(), &[]*models.Request{})
ParseAndExec(c.QueryParams().Encode(), &[]*models.Request{})
if err != nil {
return NewBadRequestError("", err)

View File

@ -74,7 +74,7 @@ func (api *recordApi) list(c echo.Context) error {
}
var rawRecords = []dbx.NullStringMap{}
result, err := searchProvider.ParseAndExec(c.QueryString(), &rawRecords)
result, err := searchProvider.ParseAndExec(c.QueryParams().Encode(), &rawRecords)
if err != nil {
return NewBadRequestError("Invalid filter parameters.", err)
}