refactor(domain): split updateFeedRecord into renameFeed and editFeed
The inPlace boolean hid two distinct intentions. Replace it with two intention-revealing operations backed by Feed.rename (presentational, never touches expiry) and Feed.edit (full edit, recomputes expiry, rejects expired). Add FeedRepository.saveConfig so these config-only edits don't re-write (and risk clobbering) the email index. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
c45f6677fe
commit
05388b45c8
6 files changed
+95
-53
No files matched your search
@@ -5,7 +5,7 @@ import { Env, FeedConfig } from "../../types";
|
||||
import { apiAuthMiddleware } from "../../lib/auth";
|
||||
import {
|
||||
createFeedRecord,
|
||||
updateFeedRecord,
|
||||
editFeed,
|
||||
deleteFeedRecord,
|
||||
} from "../../lib/feed-service";
|
||||
import { deleteAttachmentsForEmails } from "../admin/helpers";
|
||||
@@ -203,7 +203,7 @@ apiApp.openapi(
|
||||
const env = c.env;
|
||||
const { feedId } = c.req.valid("param");
|
||||
const body = c.req.valid("json");
|
||||
const result = await updateFeedRecord(env, feedId, {
|
||||
const result = await editFeed(env, feedId, {
|
||||
title: body.title,
|
||||
description: body.description,
|
||||
language: body.language,
|
||||
|
||||
Reference in new issue
Block a user