Skip to content

Commit

Permalink
draft-api: Reset started field when publishing via PATCH
Browse files Browse the repository at this point in the history
This was a bug, not sure why i didn't test this with the initial
implementation 🙃
  • Loading branch information
jnatten committed Dec 4, 2023
1 parent 8f188f8 commit 3770b71
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ trait WriteService {
val isAutomaticStatusChange = updatedApiArticle.status.isEmpty
val isAutomaticOnEditTransition = isAutomaticResponsibleChange && isAutomaticStatusChange

if (shouldNotAutoUpdateStatus) {
if (shouldNotAutoUpdateStatus && draft.status.current == PUBLISHED) {
draft.copy(started = false)
} else if (shouldNotAutoUpdateStatus) {
draft
} else if (isAutomaticOnEditTransition && statusWasUpdated) {
draft.copy(started = true)
Expand Down

0 comments on commit 3770b71

Please sign in to comment.