Skip to content

Commit

Permalink
Merge pull request #161 from notum-cz/bugfix/draft-version-validation
Browse files Browse the repository at this point in the history
fix: do not validate draft versions
  • Loading branch information
omikulcik authored Jan 2, 2024
2 parents e1e8f46 + 8bfe9de commit f8dd2f1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/services/entity-service-decorator.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const decorator = (service) => ({
},
});
data.vuid = relatedLocaleItem.vuid;
} else if(!data.vuid) {
} else if (!data.vuid) {
data.vuid = uuid();
data.versionNumber = 1;
data.isVisibleInListView = true;
Expand Down Expand Up @@ -290,7 +290,10 @@ const decorator = (service) => ({
// Create Version
const result = await service.create.call(this, uid, {
...opts,
data: newData,
data: {
...newData,
publishedAt: null,
},
});
// Relink all versions from other locales if result is The latest(published)!
if (result.isVisibleInListView && isLocalized) {
Expand Down

0 comments on commit f8dd2f1

Please sign in to comment.