Compare commits

..

No commits in common. "9e9ee0c99541f7349d405dec48faf98c5d558108" and "d953e7c4a2afadb589b464c84064fc9b6fe9ff56" have entirely different histories.

2 changed files with 3 additions and 13 deletions

View File

@ -2,9 +2,9 @@
# frozen_string_literal: true
class InvitationsController < ApplicationController
skip_before_action :authenticate_user!, only: :show
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
class InvitationsController < ApplicationController
def index
render json: Invitation.includes(:guests).as_json(
only: :id,
@ -16,16 +16,6 @@ class InvitationsController < ApplicationController
)
end
def show
invitation = Invitation.includes(:guests).find(params[:id])
if invitation
render json: invitation, only: :id, include: { guests: { only: %i[id name] } }, status: :ok
else
render json: { error: 'Invitation not found' }, status: :not_found
end
end
def create
invitation = Invitation.create

View File

@ -42,7 +42,7 @@ Rails.application.routes.draw do
resources :tables_arrangements, only: %i[index show create]
resources :summary, only: :index
resources :invitations, only: %i[show index create update destroy]
resources :invitations, only: %i[index create update destroy]
root to: redirect("/%{slug}")
end