Feature: UX-Fixes — Zahnrad weg, POI-Kombi-Typen, exp-fab-Position, Welten-Config in DB (SW by-v653)
- worlds-settings Zahnrad komplett entfernt (war auf Mobile sichtbar, auf Desktop schon hidden) - exp-fab: bottom jetzt calc(--nav-bottom-height + --safe-bottom + --space-2) — kein Overlap mit worlds-back auf iPhone - Karte POI: neue Typen bank, bank_kotbeutel, bank_kotbeutel_abfall, kotbeutel_abfall (Backend + Frontend) - Welten-Chip-Config: GET/PUT /profile/world-config, Spalte users.world_config TEXT (Migration), Sync bei Init + Speichern
This commit is contained in:
parent
f0b5e6e89b
commit
1fdba57365
9 changed files with 84 additions and 27 deletions
|
|
@ -113,3 +113,28 @@ async def upload_avatar(
|
|||
)
|
||||
|
||||
return {"avatar_url": avatar_url}
|
||||
|
||||
|
||||
# ----------------------------------------------------------
|
||||
# GET /profile/world-config — Welten-Chip-Konfiguration laden
|
||||
# PUT /profile/world-config — Welten-Chip-Konfiguration speichern
|
||||
# ----------------------------------------------------------
|
||||
import json as _json
|
||||
|
||||
@router.get('/profile/world-config')
|
||||
async def get_world_config(user=Depends(get_current_user)):
|
||||
with db() as conn:
|
||||
row = conn.execute("SELECT world_config FROM users WHERE id=?", (user['id'],)).fetchone()
|
||||
cfg = row['world_config'] if row and row['world_config'] else None
|
||||
return {"config": _json.loads(cfg) if cfg else None}
|
||||
|
||||
|
||||
class WorldConfigIn(BaseModel):
|
||||
config: dict
|
||||
|
||||
@router.put('/profile/world-config')
|
||||
async def put_world_config(body: WorldConfigIn, user=Depends(get_current_user)):
|
||||
with db() as conn:
|
||||
conn.execute("UPDATE users SET world_config=? WHERE id=?",
|
||||
(_json.dumps(body.config), user['id']))
|
||||
return {"status": "ok"}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue