Skip to content

Commit

Permalink
Mark either top-level or children modified
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettjstevens committed Oct 31, 2023
1 parent 41232ca commit 2dd944a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ export class DiscontinuousLocationEndChange extends FeatureChange {
}

try {
topLevelFeature.markModified('children')
if (topLevelFeature._id.equals(feature._id)) {
topLevelFeature.markModified('discontinuousLocations')
} else {
topLevelFeature.markModified('children')
}
await topLevelFeature.save()
} catch (error) {
logger.debug?.(`*** FAILED: ${error}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ export class DiscontinuousLocationStartChange extends FeatureChange {
}

try {
topLevelFeature.markModified('children')
if (topLevelFeature._id.equals(feature._id)) {
topLevelFeature.markModified('discontinuousLocations')
} else {
topLevelFeature.markModified('children')
}
await topLevelFeature.save()
} catch (error) {
logger.debug?.(`*** FAILED: ${error}`)
Expand Down

0 comments on commit 2dd944a

Please sign in to comment.