mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 20:05:55 +08:00
Switch to using POST for action toolbar requests [SCI-11522]
This commit is contained in:
parent
94eccb790f
commit
92861d88fb
3 changed files with 14 additions and 13 deletions
|
@ -75,6 +75,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { debounce } from '../shared/debounce.js';
|
import { debounce } from '../shared/debounce.js';
|
||||||
|
import axios from '../../packs/custom_axios.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ActionToolbar',
|
name: 'ActionToolbar',
|
||||||
|
@ -105,8 +106,8 @@ export default {
|
||||||
this.debouncedFetchActions = debounce((params) => {
|
this.debouncedFetchActions = debounce((params) => {
|
||||||
this.params = params;
|
this.params = params;
|
||||||
|
|
||||||
$.get(`${this.actionsUrl}?${new URLSearchParams(this.params).toString()}`, (data) => {
|
axios.post(this.actionsUrl, this.params).then((response) => {
|
||||||
this.actions = data.actions;
|
this.actions = response.data.actions;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.setButtonOverflow();
|
this.setButtonOverflow();
|
||||||
if (this.actionsLoadedCallback) this.$nextTick(this.actionsLoadedCallback);
|
if (this.actionsLoadedCallback) this.$nextTick(this.actionsLoadedCallback);
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default {
|
||||||
name: 'ActionToolbar',
|
name: 'ActionToolbar',
|
||||||
props: {
|
props: {
|
||||||
actionsUrl: { type: String, required: true },
|
actionsUrl: { type: String, required: true },
|
||||||
actionsMethod: { type: String, default: 'get' },
|
actionsMethod: { type: String, default: 'post' },
|
||||||
params: { type: Object },
|
params: { type: Object },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -64,7 +64,7 @@ Rails.application.routes.draw do
|
||||||
get :template_tags
|
get :template_tags
|
||||||
get :zpl_preview
|
get :zpl_preview
|
||||||
post :sync_fluics_templates
|
post :sync_fluics_templates
|
||||||
get :actions_toolbar
|
post :actions_toolbar
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ Rails.application.routes.draw do
|
||||||
defaults: { format: 'json' }
|
defaults: { format: 'json' }
|
||||||
get 'create_modal', to: 'repositories#create_modal',
|
get 'create_modal', to: 'repositories#create_modal',
|
||||||
defaults: { format: 'json' }
|
defaults: { format: 'json' }
|
||||||
get 'actions_toolbar'
|
post 'actions_toolbar'
|
||||||
get :list
|
get :list
|
||||||
get :rows_list
|
get :rows_list
|
||||||
end
|
end
|
||||||
|
@ -279,7 +279,7 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
collection do
|
collection do
|
||||||
get :project_contents
|
get :project_contents
|
||||||
get 'actions_toolbar'
|
post 'actions_toolbar'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
get 'reports/datatable', to: 'reports#datatable'
|
get 'reports/datatable', to: 'reports#datatable'
|
||||||
|
@ -387,7 +387,7 @@ Rails.application.routes.draw do
|
||||||
get 'users_filter'
|
get 'users_filter'
|
||||||
post 'archive_group'
|
post 'archive_group'
|
||||||
post 'restore_group'
|
post 'restore_group'
|
||||||
get 'actions_toolbar'
|
post 'actions_toolbar'
|
||||||
get :user_roles
|
get :user_roles
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -412,7 +412,7 @@ Rails.application.routes.draw do
|
||||||
get 'inventory_assigning_experiment_filter'
|
get 'inventory_assigning_experiment_filter'
|
||||||
get 'clone_modal', action: :clone_modal
|
get 'clone_modal', action: :clone_modal
|
||||||
get 'move_modal', action: :move_modal
|
get 'move_modal', action: :move_modal
|
||||||
get 'actions_toolbar'
|
post 'actions_toolbar'
|
||||||
get 'move_modal' # return modal with move options
|
get 'move_modal' # return modal with move options
|
||||||
post 'move' # move experiment
|
post 'move' # move experiment
|
||||||
end
|
end
|
||||||
|
@ -458,7 +458,7 @@ Rails.application.routes.draw do
|
||||||
post 'save_table_state', on: :collection, defaults: { format: 'json' }
|
post 'save_table_state', on: :collection, defaults: { format: 'json' }
|
||||||
|
|
||||||
collection do
|
collection do
|
||||||
get 'actions_toolbar'
|
post 'actions_toolbar'
|
||||||
get 'inventory_assigning_my_module_filter'
|
get 'inventory_assigning_my_module_filter'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -703,7 +703,7 @@ Rails.application.routes.draw do
|
||||||
post 'protocolsio_import_save', to: 'protocols#protocolsio_import_save'
|
post 'protocolsio_import_save', to: 'protocols#protocolsio_import_save'
|
||||||
get 'export', to: 'protocols#export'
|
get 'export', to: 'protocols#export'
|
||||||
get 'protocolsio', to: 'protocols#protocolsio_index'
|
get 'protocolsio', to: 'protocols#protocolsio_index'
|
||||||
get 'actions_toolbar', to: 'protocols#actions_toolbar'
|
post 'actions_toolbar', to: 'protocols#actions_toolbar'
|
||||||
get 'user_roles', to: 'protocols#user_roles'
|
get 'user_roles', to: 'protocols#user_roles'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -769,7 +769,7 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
|
|
||||||
collection do
|
collection do
|
||||||
get :actions_toolbar
|
post :actions_toolbar
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :repository_row_connections, only: %i(create destroy) do
|
resources :repository_row_connections, only: %i(create destroy) do
|
||||||
|
@ -839,7 +839,7 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
resources :storage_locations, only: %i(index create destroy update show) do
|
resources :storage_locations, only: %i(index create destroy update show) do
|
||||||
collection do
|
collection do
|
||||||
get :actions_toolbar
|
post :actions_toolbar
|
||||||
get :tree
|
get :tree
|
||||||
end
|
end
|
||||||
member do
|
member do
|
||||||
|
@ -869,7 +869,7 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
|
|
||||||
collection do
|
collection do
|
||||||
get :actions_toolbar
|
post :actions_toolbar
|
||||||
post :archive
|
post :archive
|
||||||
post :restore
|
post :restore
|
||||||
get :user_roles
|
get :user_roles
|
||||||
|
|
Loading…
Add table
Reference in a new issue