Skip to content

Commit

Permalink
Added missing entries duplication to template duplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigJk committed Jan 3, 2023
1 parent 715c5a9 commit 5b55056
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions frontend/src/js/ui/views/templates/new.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,20 @@ export default () => {
return;
}

api.saveTemplate(state.template).then(() => {
success('Template saved');
store.pub('reload_templates');
m.route.set('/templates');
}, error);
api
.saveTemplate(state.template)
.then(() => {
// if this is a duplication we want to copy the entries from the original to the duplicated.
if (vnode.attrs.id) {
return api.copyEntries(vnode.attrs.id, `tmpl:${state.template.author}+${state.template.slug}`);
}
})
.then(() => {
success('Template saved');
store.pub('reload_templates');
m.route.set('/templates');
})
.catch(error);
}}
>
Save
Expand Down

0 comments on commit 5b55056

Please sign in to comment.