docs: fix history API client to encode date in query string
publicPlGet only accepts a URL; align the plan with that signature. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
abcdf793c4
commit
74146de156
1 file changed
+4
-5
@@ -340,15 +340,14 @@ export interface PublicTransportHistoryPage {
|
||||
export const publicTransportApi = {
|
||||
getPage: (token: string) => publicPlGet<PublicTransportPage>(`/public/pl/transport/${token}`),
|
||||
getHistory: (token: string, date: string) =>
|
||||
publicPlGet<PublicTransportHistoryPage>(`/public/pl/transport/${token}/history`, {
|
||||
params: { date }
|
||||
}),
|
||||
publicPlGet<PublicTransportHistoryPage>(
|
||||
`/public/pl/transport/${token}/history?date=${encodeURIComponent(date)}`
|
||||
),
|
||||
// ...saveFeedback / uploadAttachment 保持不变
|
||||
}
|
||||
```
|
||||
|
||||
确认 `publicPlGet` 支持第二参 `params`(与项目其他 public API 一致);若不支持,改为
|
||||
`` `/public/pl/transport/${token}/history?date=${encodeURIComponent(date)}` ``。
|
||||
说明:`publicPlGet` 仅接受 URL 字符串,日期必须拼在 query 上。
|
||||
|
||||
- [ ] **Step 2: Commit**
|
||||
|
||||
|
||||
Reference in new issue
Block a user