feat: Expand ActivityEntry model and enhance activity log handling
- Added new fields to the ActivityEntry model for improved tracking: hr_min, pace_min_per_km, cadence, avg_power, elevation_gain, temperature_celsius, humidity_percent, avg_hr_percent, and kcal_per_km. - Updated the create_activity function to accommodate the new fields in the activity log. - Modified session metrics handling to ensure accurate data retrieval and merging based on the updated schema.
This commit is contained in:
1 parent
3296dfca28
commit
766b64cd64
4 files changed
+67
-7
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect, useRef } from 'react'
|
||||
import { useState, useEffect, useRef, startTransition } from 'react'
|
||||
import { Upload, Pencil, Trash2, Check, X, CheckCircle } from 'lucide-react'
|
||||
import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, CartesianGrid } from 'recharts'
|
||||
import { api } from '../utils/api'
|
||||
@@ -26,7 +26,16 @@ const ACTIVITY_LOG_PAYLOAD_KEYS = new Set([
|
||||
'kcal_resting',
|
||||
'hr_avg',
|
||||
'hr_max',
|
||||
'hr_min',
|
||||
'distance_km',
|
||||
'pace_min_per_km',
|
||||
'cadence',
|
||||
'avg_power',
|
||||
'elevation_gain',
|
||||
'temperature_celsius',
|
||||
'humidity_percent',
|
||||
'avg_hr_percent',
|
||||
'kcal_per_km',
|
||||
'rpe',
|
||||
'source',
|
||||
'notes',
|
||||
@@ -412,7 +421,9 @@ export default function ActivityPage() {
|
||||
}
|
||||
setEditing(null)
|
||||
setSessionDetail(null)
|
||||
await load()
|
||||
startTransition(() => {
|
||||
void load()
|
||||
})
|
||||
} catch (err) {
|
||||
setError(err.message || 'Speichern fehlgeschlagen')
|
||||
setTimeout(() => setError(null), 6000)
|
||||
|
||||
Reference in new issue
Block a user