mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix(metric): add validation for logFocusSession operation payload
Adds explicit validation for the {day, duration} payload structure used by
logFocusSession action. This prevents the false positive warning about
"unusual structure" while maintaining correct validation for all other
METRIC operations. The specialized payload format is intentional for
append-only focus session logging.
This commit is contained in:
parent
c4a9a05055
commit
9ebf98ff3c
1 changed files with 6 additions and 0 deletions
|
|
@ -112,6 +112,12 @@ const validateUpdatePayload = (
|
|||
return { success: true };
|
||||
}
|
||||
|
||||
// METRIC focus session logging uses a special shape: { day, duration }
|
||||
// This comes from logFocusSession action (see metric.actions.ts)
|
||||
if (entityType === 'METRIC' && 'day' in p && 'duration' in p) {
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
// Update payloads can have various shapes:
|
||||
// 1. { task: { id, changes } } or { project: { id, changes } }
|
||||
// 2. { id, changes }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue