fix: preserve blank CVs and reliable editor undo
This commit is contained in:
@@ -46,6 +46,7 @@ public sealed class CvAiSuggestionService(
|
||||
if (document != (targetId is null)) throw Error(400, "cv_ai_scope_invalid");
|
||||
var snapshot = await SnapshotAsync(owner, id, ct);
|
||||
RequireCurrent(snapshot, version, null);
|
||||
if (document && snapshot.Blocks.Count == 0) throw Error(400, "cv_ai_source_empty");
|
||||
var source = Source(targetId is null ? snapshot.Blocks : snapshot.EditableBlocks, targetId);
|
||||
if (inputText is not null && !string.Equals(ContentLines(inputText), ContentLines(source.Text), StringComparison.Ordinal))
|
||||
throw Error(409, "cv_ai_source_changed");
|
||||
|
||||
Reference in New Issue
Block a user