Production Release: RestDays Widget + Trainingstyp Fix #16

Merged
Lars merged 10 commits from develop into main 2026-03-23 09:24:17 +01:00
Showing only changes of commit 7d627cf128 - Show all commits

View File

@ -9,6 +9,7 @@ from datetime import datetime, timedelta
from fastapi import APIRouter, HTTPException, Depends, Header from fastapi import APIRouter, HTTPException, Depends, Header
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
from psycopg2.extras import Json
from db import get_db, get_cursor, r2d from db import get_db, get_cursor, r2d
from auth import require_auth from auth import require_auth
@ -103,7 +104,7 @@ def create_rest_day(
note = EXCLUDED.note note = EXCLUDED.note
RETURNING id, profile_id, date, rest_config, note, created_at RETURNING id, profile_id, date, rest_config, note, created_at
""", """,
(pid, data.date, config_dict, data.note) (pid, data.date, Json(config_dict), data.note)
) )
result = cur.fetchone() result = cur.fetchone()
@ -161,7 +162,7 @@ def update_rest_day(
if data.rest_config: if data.rest_config:
updates.append("rest_config = %s") updates.append("rest_config = %s")
values.append(data.rest_config.model_dump()) values.append(Json(data.rest_config.model_dump()))
if data.note is not None: if data.note is not None:
updates.append("note = %s") updates.append("note = %s")