Skip to content

fix: paginator with query strings

Shih-Tse Chang requested to merge 6-paginator-with-query-string into main

Closes #6 (closed)

補上 query string

在 local 測過,執行GET http://localhost:8000/api/jobs?filter[updated_at][is]=null後產生的東西如下

{
    "data": [],
    "links": {
        "first": "http:\/\/localhost:8000\/api\/jobs?filter%5Bupdated_at%5D%5Bis%5D=null&page=1",
        "last": "http:\/\/localhost:8000\/api\/jobs?filter%5Bupdated_at%5D%5Bis%5D=null&page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": null,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "pagination.previous",
                "active": false
            },
            {
                "url": "http:\/\/localhost:8000\/api\/jobs?filter%5Bupdated_at%5D%5Bis%5D=null&page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "pagination.next",
                "active": false
            }
        ],
        "path": "http:\/\/localhost:8000\/api\/jobs",
        "per_page": 20,
        "to": null,
        "total": 0
    }
}

URL 有 encode 起來,URL 沒問題有包含到 query string

有觀察到 query string 的順序不會跟原始的一樣

  • 01/18 survey & coding
    • 16:52-17:21 (29m)

Merge request reports