Skip to content

Commit

Permalink
change bulk delete route
Browse files Browse the repository at this point in the history
  • Loading branch information
RonWalker22 committed Feb 16, 2021
1 parent 09af087 commit e2e0cf3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/javascript/dashboard/api/feedbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Feedbacks extends ApiClient {

bulkDelete(data) {
// eslint-disable-next-line no-undef
return axios.post(`${this.url}/bulk_destroy`, data);
return axios.delete(`${this.url}/bulk_destroy`, { data: data });
}
}

Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
resources :feedbacks, only: [:create, :index, :update, :show] do
collection do
post :bulk_update
post :bulk_destroy
delete :bulk_destroy
end
end
resources :clarification_posts, only: [:create, :destroy]
Expand Down
6 changes: 4 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_02_12_154240) do
ActiveRecord::Schema.define(version: 2022_01_14_202310) do

# These are extensions that must be enabled in order to support this database
enable_extension "pg_stat_statements"
Expand Down Expand Up @@ -631,9 +631,11 @@
t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy"
t.index ["taggable_id"], name: "index_taggings_on_taggable_id"
t.index ["taggable_type", "taggable_id"], name: "index_taggings_on_taggable_type_and_taggable_id"
t.index ["taggable_type"], name: "index_taggings_on_taggable_type"
t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type"
t.index ["tagger_id"], name: "index_taggings_on_tagger_id"
t.index ["tagger_type", "tagger_id"], name: "index_taggings_on_tagger_type_and_tagger_id"
end

create_table "tags", id: :serial, force: :cascade do |t|
Expand Down Expand Up @@ -737,6 +739,7 @@
add_foreign_key "contact_inboxes", "inboxes"
add_foreign_key "conversations", "contact_inboxes"
add_foreign_key "conversations", "teams"
add_foreign_key "data_imports", "accounts"
add_foreign_key "feedback_contacts", "contacts"
add_foreign_key "feedback_contacts", "feedbacks"
add_foreign_key "feedback_users", "feedbacks"
Expand All @@ -745,7 +748,6 @@
add_foreign_key "proposal_users", "proposals"
add_foreign_key "proposal_users", "users"
add_foreign_key "roadmap_items", "feedbacks"
add_foreign_key "data_imports", "accounts"
add_foreign_key "team_members", "teams"
add_foreign_key "team_members", "users"
add_foreign_key "teams", "accounts"
Expand Down

0 comments on commit e2e0cf3

Please sign in to comment.