aboutsummaryrefslogtreecommitdiff
path: root/src/lib/server/services/routine-actions.ts
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-09-25 09:10:31 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-09-25 09:10:31 +0200
commit760a61001edafb462ca9c7f5bc8013f31fb15a5c (patch)
tree50f906de9ddaefb7362d444937f7ff4177ee2a7a /src/lib/server/services/routine-actions.ts
parente5e1482b1f5aea4a50de44801c81c81750042201 (diff)
Compress comments to terse single lines within line width
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');