MCPcopy Create free account
hub / github.com/ImGoodBai/MapGoGoGo / update_me

Function update_me

backend/app/main.py:245–260  ·  view source on GitHub ↗
(
    payload: ParticipantUpdate,
    response: Response,
    participant=Cookie(default=None, alias=COOKIE_NAME),
)

Source from the content-addressed store, hash-verified

243
244@app.post("/api/me")
245def update_me(
246 payload: ParticipantUpdate,
247 response: Response,
248 participant=Cookie(default=None, alias=COOKIE_NAME),
249) -> dict:
250 current = get_or_create_participant(response, participant)
251 nickname = payload.nickname.strip() or default_nickname(current["id"])
252 with connect() as conn:
253 conn.execute(
254 "UPDATE participants SET nickname = ?, updated_at = ? WHERE id = ?",
255 (nickname, now_iso(), current["id"]),
256 )
257 row = conn.execute(
258 "SELECT * FROM participants WHERE id = ?", (current["id"],)
259 ).fetchone()
260 return {"participant": row_to_dict(row)}
261
262
263@app.get("/api/challenges")

Callers

nothing calls this directly

Calls 5

default_nicknameFunction · 0.85
connectFunction · 0.85
now_isoFunction · 0.85
row_to_dictFunction · 0.85

Tested by

no test coverage detected