Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
Co-authored-by: Miguel Angel <[email protected]>
  • Loading branch information
caleeli and Miguel Angel authored Feb 22, 2024
1 parent d78e9f2 commit 86114c8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/vue-form-builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1145,17 +1145,14 @@ export default {
},
// This function is used to calculate the new index of the references
calcNewIndexFor(index, referencedBy) {
if (index > this.pageDelete) {
return index - 1;
}
if (index === this.pageDelete) {
throw new Error(
`${this.$t(
"Can not delete this page, it is referenced by"
)}: ${referencedBy}`
);
}
return index;
return index > this.pageDelete ? index - 1 : index;
},
// Update Record list references
updateRecordListReferences() {
Expand Down

0 comments on commit 86114c8

Please sign in to comment.