diff --git a/app/javascript/vue/my_modules/list.vue b/app/javascript/vue/my_modules/list.vue index 8d6c0bf9b..5809969c4 100644 --- a/app/javascript/vue/my_modules/list.vue +++ b/app/javascript/vue/my_modules/list.vue @@ -302,8 +302,9 @@ export default { edit(_e, rows) { [this.editModalObject] = rows; }, - move(_e, rows) { + move(event, rows) { [this.moveModalObject] = rows; + this.moveModalObject.movePath = event.path; }, duplicate(event, rows) { axios.post(event.path, { my_module_ids: rows.map((row) => row.id) }).then(() => { diff --git a/app/javascript/vue/my_modules/modals/move.vue b/app/javascript/vue/my_modules/modals/move.vue index d9d408f19..452960f13 100644 --- a/app/javascript/vue/my_modules/modals/move.vue +++ b/app/javascript/vue/my_modules/modals/move.vue @@ -52,9 +52,8 @@ export default { }, methods: { submit() { - axios.post(this.my_module.urls.move, { - to_experiment_id: this.targetExperiment, - my_module_ids: [this.my_module.id] + axios.post(this.my_module.movePath, { + to_experiment_id: this.targetExperiment }).then((response) => { this.$emit('move'); HelperModule.flashAlertMsg(response.data.message, 'success'); diff --git a/app/serializers/lists/my_module_serializer.rb b/app/serializers/lists/my_module_serializer.rb index 5a0bbf934..d3af4c922 100644 --- a/app/serializers/lists/my_module_serializer.rb +++ b/app/serializers/lists/my_module_serializer.rb @@ -61,7 +61,6 @@ module Lists assigned_tags: assigned_tags_my_module_my_module_tags_path(object), users_list: search_my_module_user_my_module_path(object, my_module_id: object.id), experiments_to_move: experiments_to_move_experiment_path(object.experiment), - move: move_modules_experiment_path(object.experiment), update: my_module_path(object), show_access: access_permissions_my_module_path(object), provisioning_status: provisioning_status_my_module_url(object) diff --git a/app/services/toolbars/my_modules_service.rb b/app/services/toolbars/my_modules_service.rb index d73e90d9c..2efb4d24a 100644 --- a/app/services/toolbars/my_modules_service.rb +++ b/app/services/toolbars/my_modules_service.rb @@ -89,7 +89,8 @@ module Toolbars name: 'move', label: I18n.t('experiments.table.toolbar.move'), icon: 'sn-icon sn-icon-move', - type: :emit + type: :emit, + path: move_modules_experiment_path(@my_modules.first.experiment, my_module_ids: @my_modules.pluck(:id)) } end