Merge pull request 'master' (#14) from master into dev
Reviewed-on: #14
This commit is contained in:
commit
73569e0839
@ -1,3 +1,4 @@
|
||||
import bson
|
||||
import fastapi
|
||||
import pydantic
|
||||
|
||||
@ -37,14 +38,14 @@ async def post(body: RequestPostBody):
|
||||
|
||||
@router.put('/api/v1/experiments', status_code=fastapi.status.HTTP_202_ACCEPTED, responses={404: {'description': 'Not found'}})
|
||||
async def put(body: RequestPutBody):
|
||||
changed = await experiments.update(id=body.id, enabled=body.enabled, condition=body.condition)
|
||||
changed = await experiments.update(id=bson.ObjectId(body.id), enabled=body.enabled, condition=body.condition)
|
||||
if not changed:
|
||||
raise fastapi.HTTPException(404)
|
||||
|
||||
|
||||
@router.delete('/api/v1/experiments', status_code=fastapi.status.HTTP_202_ACCEPTED, responses={404: {'description': 'Not found'}})
|
||||
async def delete(body: RequestDeleteBody):
|
||||
changed = await experiments.delete(id=body.id)
|
||||
changed = await experiments.delete(id=bson.ObjectId(body.id))
|
||||
if not changed:
|
||||
raise fastapi.HTTPException(404)
|
||||
|
||||
|
@ -20,7 +20,7 @@ class PlatformStaff(pydantic.BaseModel):
|
||||
|
||||
|
||||
class ResponseBody(pydantic.BaseModel):
|
||||
configs: dict[str, dict]
|
||||
configs: dict[str, dict|list]
|
||||
experiments: dict[str, ExperimentData]
|
||||
platform_staff: PlatformStaff
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user