diff --git a/backend/app/services/site_finder/weight_profiles.py b/backend/app/services/site_finder/weight_profiles.py index 07dc2413..7f3f0ad2 100644 --- a/backend/app/services/site_finder/weight_profiles.py +++ b/backend/app/services/site_finder/weight_profiles.py @@ -99,7 +99,7 @@ _INSERT = """ INSERT INTO user_weight_profiles (user_id, profile_name, weights, is_default, description) VALUES - (:user_id, :profile_name, :weights::jsonb, :is_default, :description) + (:user_id, :profile_name, CAST(:weights AS jsonb), :is_default, :description) RETURNING id, created_at, updated_at """ @@ -270,7 +270,7 @@ def update_profile( params["profile_name"] = payload.profile_name if payload.weights is not None: - sets.append("weights = :weights::jsonb") + sets.append("weights = CAST(:weights AS jsonb)") params["weights"] = json.dumps(payload.weights, ensure_ascii=False) if payload.description is not None: