mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Specify accepted format on client side
I don't know why, but even though the client sends http accept header for json, rails is treating it as html. This was being overridden in the route, but I want to support multiple formats next. So, we explicitly choose the format by adding it to the request path.
This commit is contained in:
@@ -31,7 +31,7 @@ angular.module("admin.indexUtils").factory 'Columns', ($rootScope, $http, $injec
|
||||
savePreferences: (action_name) =>
|
||||
$http
|
||||
method: "PUT"
|
||||
url: "/admin/column_preferences/bulk_update"
|
||||
url: "/admin/column_preferences/bulk_update.json"
|
||||
data:
|
||||
action_name: action_name
|
||||
column_preferences: (preference for column_name, preference of @columns)
|
||||
|
||||
@@ -95,7 +95,7 @@ Openfoodnetwork::Application.routes.draw do
|
||||
|
||||
resource :contents
|
||||
|
||||
resources :column_preferences, only: [], format: :json do
|
||||
resources :column_preferences, only: [] do
|
||||
put :bulk_update, on: :collection
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user