Skip to content

Commit 5ff2732

Browse files
committed
Prevent a request when changing from an empty array to another empty array since vue sees it as a change.
1 parent 8e90761 commit 5ff2732

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resources/js/components/inputs/relationship/RelationshipInput.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@ export default {
203203
this.$emit('item-data-updated', data);
204204
},
205205
206-
value(value) {
206+
value(value, oldValue) {
207+
if (JSON.stringify(value) === JSON.stringify(oldValue)) return;
208+
207209
// If all the values already have their data stored, then don't bother fetching it again.
208210
if (value.every(id => this.data.map(item => item.id).includes(id))) return;
209211

0 commit comments

Comments
 (0)