fix(server): revert accidental undo changes

This commit is contained in:
Nicholas Tindle
2024-09-10 12:41:41 -05:00
parent e27f5bb2e5
commit 212b04c1f4

View File

@@ -1,7 +1,7 @@
# Analytics API
import typing
from typing import Annotated
from typing import Annotated, Optional
import fastapi
import prisma
@@ -20,10 +20,6 @@ class UserData(pydantic.BaseModel):
username: str
class TutorialStepData(pydantic.BaseModel):
data: typing.Optional[dict]
@router.post(path="/log_new_user")
async def log_create_user(
user_id: Annotated[str, fastapi.Depends(get_user_id)],
@@ -45,8 +41,8 @@ async def log_create_user(
@router.post(path="/log_tutorial_step")
async def log_tutorial_step(
user_id: Annotated[str, fastapi.Depends(get_user_id)],
step: Annotated[int, fastapi.Query(..., embed=True)],
data: Annotated[TutorialStepData, fastapi.Body(..., embed=True)],
step: Annotated[int, fastapi.Body(..., embed=True)],
data: Annotated[Optional[dict], fastapi.Body(..., embed=True)],
):
"""
Log the tutorial step completed by the user for analytics purposes.
@@ -55,7 +51,7 @@ async def log_tutorial_step(
data={
"userId": user_id,
"type": prisma.enums.AnalyticsType.TUTORIAL_STEP,
"data": prisma.Json(data.model_dump_json()),
"data": prisma.Json(data),
"dataIndex": step,
}
)