mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 09:13:05 +08:00
Improve code [SCI-10292]
This commit is contained in:
parent
b59392b932
commit
53039ba5ee
4 changed files with 6 additions and 7 deletions
|
@ -240,9 +240,9 @@ export default {
|
|||
duplicate(_e, experiment) {
|
||||
[this.duplicateModalObject] = experiment;
|
||||
},
|
||||
move(_e, rows) {
|
||||
move(event, rows) {
|
||||
[this.moveModalObject] = rows;
|
||||
this.moveModalObject.experimentIds = rows.map((exp) => exp.id);
|
||||
this.moveModalObject.movePath = event.path;
|
||||
},
|
||||
edit(_e, experiment) {
|
||||
[this.editModalObject] = experiment;
|
||||
|
|
|
@ -54,9 +54,8 @@ export default {
|
|||
methods: {
|
||||
async submit() {
|
||||
this.disableSubmit = true;
|
||||
await axios.post(this.experiment.urls.move, {
|
||||
project_id: this.targetProject,
|
||||
ids: this.experiment.experimentIds
|
||||
await axios.post(this.experiment.movePath, {
|
||||
project_id: this.targetProject
|
||||
}).then((response) => {
|
||||
this.$emit('move');
|
||||
window.location.replace(response.data.path);
|
||||
|
|
|
@ -69,7 +69,6 @@ module Lists
|
|||
actions: actions_toolbar_experiments_path(items: [{ id: object.id }].to_json),
|
||||
projects_to_clone: projects_to_clone_experiment_path(object),
|
||||
projects_to_move: projects_to_move_experiment_path(object),
|
||||
move: move_experiments_path,
|
||||
clone: clone_experiment_path(object),
|
||||
update: experiment_path(object),
|
||||
show_access: access_permissions_experiment_path(object),
|
||||
|
|
|
@ -87,7 +87,8 @@ module Toolbars
|
|||
name: 'move',
|
||||
label: I18n.t('experiments.toolbar.move_button'),
|
||||
icon: 'sn-icon sn-icon-move',
|
||||
type: :emit
|
||||
type: :emit,
|
||||
path: move_experiments_path(ids: @experiments.pluck(:id))
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue