Configure endpoint to support bulk updates
All checks were successful
Run unit tests / unit_tests (pull_request) Successful in 6m0s
Build Nginx-based docker image / build-static-assets (pull_request) Successful in 28m5s

This commit is contained in:
Manuel Bustillo 2024-10-27 14:03:13 +01:00
parent da05d24e7b
commit 507d068459
4 changed files with 18 additions and 0 deletions

View File

@ -1,2 +1,13 @@
class ApplicationController < ActionController::Base
after_action :set_csrf_cookie
private
def set_csrf_cookie
cookies["csrf-token"] = {
value: form_authenticity_token,
secure: Rails.env.production?,
same_site: :strict,
}
end
end

View File

@ -75,6 +75,10 @@ class GuestsController < ApplicationController
redirect_to guests_url
end
def bulk_update
render json: {}, status: :ok
end
private
# Use callbacks to share common setup or constraints between actions.

View File

@ -73,4 +73,6 @@ Rails.application.configure do
# Raise error when a before_action's only/except options reference missing actions
config.action_controller.raise_on_missing_callback_actions = true
config.hosts << "libre-wedding-planner.app.localhost"
end

View File

@ -2,6 +2,7 @@ Rails.application.routes.draw do
resources :groups, only: :index
resources :guests do
post :import, on: :collection
post :bulk_update, on: :collection
end
resources :expenses
resources :tables_arrangements, only: [:index, :show]