feat(bx): raise my reimburses pageSize max to 500 for apply list pilot
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
02a29c3328
commit
f342208a8a
2 files changed
+17
-2
No files matched your search
@@ -3,7 +3,7 @@ from datetime import date as date_cls
|
||||
from typing import List, Optional
|
||||
from urllib.parse import quote
|
||||
|
||||
from fastapi import APIRouter, Depends, File, HTTPException, UploadFile, status
|
||||
from fastapi import APIRouter, Depends, File, HTTPException, Query, UploadFile, status
|
||||
from fastapi.responses import StreamingResponse
|
||||
from sqlalchemy import or_
|
||||
from sqlalchemy.orm import Session
|
||||
@@ -192,7 +192,7 @@ def list_reimburses(
|
||||
@router.get("/my", response_model=ApiResponse[PagedData[ReimburseApplyOut]])
|
||||
def my_reimburses(
|
||||
page: int = 1,
|
||||
pageSize: int = 10,
|
||||
pageSize: int = Query(10, ge=1, le=500),
|
||||
status: Optional[str] = None,
|
||||
keyword: str = "",
|
||||
expenseName: Optional[str] = None,
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import inspect
|
||||
|
||||
from fastapi.params import Query as QueryParam
|
||||
|
||||
from app.api.bx.reimburse import my_reimburses
|
||||
|
||||
|
||||
def test_my_reimburses_page_size_query_bounds():
|
||||
param = inspect.signature(my_reimburses).parameters["pageSize"]
|
||||
q = param.default
|
||||
assert isinstance(q, QueryParam)
|
||||
attrs = q._attributes_set
|
||||
assert attrs["ge"] == 1
|
||||
assert attrs["le"] == 500
|
||||
assert q.default == 10
|
||||
Reference in new issue
Block a user