mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-20 11:03:08 +00:00
fix: Strip runtime and state fields when duplicating features
This commit is contained in:
@@ -1092,8 +1092,20 @@ export function useBoardActions({
|
||||
|
||||
const handleDuplicateFeature = useCallback(
|
||||
async (feature: Feature, asChild: boolean = false) => {
|
||||
// Copy all feature data, only override id/status (handled by create) and dependencies if as child
|
||||
const { id: _id, status: _status, ...featureData } = feature;
|
||||
// Copy all feature data, stripping id, status (handled by create), and runtime/state fields
|
||||
const {
|
||||
id: _id,
|
||||
status: _status,
|
||||
startedAt: _startedAt,
|
||||
error: _error,
|
||||
summary: _summary,
|
||||
spec: _spec,
|
||||
passes: _passes,
|
||||
planSpec: _planSpec,
|
||||
descriptionHistory: _descriptionHistory,
|
||||
titleGenerating: _titleGenerating,
|
||||
...featureData
|
||||
} = feature;
|
||||
const duplicatedFeatureData = {
|
||||
...featureData,
|
||||
// If duplicating as child, set source as dependency; otherwise keep existing
|
||||
|
||||
Reference in New Issue
Block a user