master #10
@ -28,7 +28,7 @@ class ResponseBody(pydantic.BaseModel):
|
|||||||
router = fastapi.APIRouter()
|
router = fastapi.APIRouter()
|
||||||
|
|
||||||
|
|
||||||
@router.post('/api/v1/fetch')
|
@router.get('/api/v1/fetch')
|
||||||
async def execute(stage: str, project: str):
|
async def execute(stage: str, project: str):
|
||||||
confs, exps, staffs = await asyncio.gather(
|
confs, exps, staffs = await asyncio.gather(
|
||||||
configs.get(project=project, stage=stage),
|
configs.get(project=project, stage=stage),
|
||||||
|
@ -35,4 +35,5 @@ async def get(project: str, stage: str) -> list[Config]:
|
|||||||
result = []
|
result = []
|
||||||
async for item in collection.find({'stage': stage, 'project': project}):
|
async for item in collection.find({'stage': stage, 'project': project}):
|
||||||
result.append(Config.model_validate(item))
|
result.append(Config.model_validate(item))
|
||||||
|
result[-1]._id = item['_id']
|
||||||
return result
|
return result
|
||||||
|
@ -36,4 +36,5 @@ async def get(project: str, stage: str) -> list[Experiment]:
|
|||||||
result = []
|
result = []
|
||||||
async for item in collection.find({'stage': stage, 'project': project}):
|
async for item in collection.find({'stage': stage, 'project': project}):
|
||||||
result.append(Experiment.model_validate(item))
|
result.append(Experiment.model_validate(item))
|
||||||
|
result[-1]._id = item['_id']
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user