aboutsummaryrefslogtreecommitdiff
path: root/src/lib/server/services/routine-actions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/server/services/routine-actions.ts')
-rw-r--r--src/lib/server/services/routine-actions.ts11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/lib/server/services/routine-actions.ts b/src/lib/server/services/routine-actions.ts
index 64d0a1b..28a25cc 100644
--- a/src/lib/server/services/routine-actions.ts
+++ b/src/lib/server/services/routine-actions.ts
@@ -2,13 +2,7 @@ import { fail, type ActionFailure } from '@sveltejs/kit';
import { archive, complete, edit, loadCurrent } from './routines';
import { parseFormString, parseFrequencyDays } from './validation';
-/**
- * Shared implementations of the routine edit/complete form actions, used by
- * both the project dashboard (/projects/[id]) and the routine page
- * (/projects/[projectId]/routine/[routineId]). Guarding and failure messages
- * are the strictest common denominator: a missing or archived routine is
- * rejected before any write.
- */
+/** Shared routine edit/complete actions; rejects missing/archived routines. */
export type EditRoutineResult =
ActionFailure<{ error: string }> | { success: boolean; type?: 'edit' };
@@ -38,8 +32,7 @@ export async function editRoutineAction(
return fail(400, { error: 'Fréquence invalide' });
}
- // The dashboard row form has no description field; only touch it when the
- // form actually sends one, so list edits never wipe a description.
+ // Only touch description when the form sends one; list edits never wipe it.
const fields: { name: string; frequencyDays: number; description?: string } =
{ name, frequencyDays };
const description = data.get('description');