Compare commits

..

6 Commits

Author SHA1 Message Date
Renovate Bot
e15312ced5 Update dependency ruby to v3.4.4
Some checks failed
Run unit tests / rubocop (pull_request) Failing after 1m34s
Run unit tests / check-licenses (pull_request) Failing after 2m28s
Run unit tests / unit_tests (pull_request) Failing after 11m7s
Run unit tests / build-static-assets (pull_request) Has been skipped
Run unit tests / copyright_notice (pull_request) Successful in 10m23s
2025-06-13 02:05:07 +00:00
f02a6b6a3d Merge pull request 'Allow updating the status of guests from unauthenticated sessions' (#280) from guest-update-from-invitation into main
All checks were successful
Run unit tests / rubocop (push) Has been skipped
Run unit tests / check-licenses (push) Has been skipped
Run unit tests / copyright_notice (push) Has been skipped
Run unit tests / unit_tests (push) Successful in 54s
Run unit tests / build-static-assets (push) Successful in 8m32s
Reviewed-on: #280
2025-06-12 21:26:00 +00:00
efb5cf64f5 Minor changes
All checks were successful
Run unit tests / rubocop (pull_request) Successful in 1m27s
Run unit tests / copyright_notice (pull_request) Successful in 2m45s
Run unit tests / check-licenses (pull_request) Successful in 2m46s
Run unit tests / unit_tests (pull_request) Successful in 4m26s
Run unit tests / build-static-assets (pull_request) Successful in 20m24s
2025-06-12 23:01:03 +02:00
9a99981f67 Allow updating the status of guests from unauthenticated sessions
Some checks failed
Run unit tests / rubocop (pull_request) Failing after 1m4s
Run unit tests / check-licenses (pull_request) Successful in 1m7s
Run unit tests / copyright_notice (pull_request) Successful in 1m38s
Run unit tests / unit_tests (pull_request) Successful in 3m57s
Run unit tests / build-static-assets (pull_request) Successful in 26m1s
2025-06-12 22:53:50 +02:00
9e9ee0c995 Merge pull request 'Define a new public endpoint to get information about an invitation' (#279) from invitations-show-endpoint into main
All checks were successful
Run unit tests / rubocop (push) Has been skipped
Run unit tests / check-licenses (push) Has been skipped
Run unit tests / copyright_notice (push) Has been skipped
Run unit tests / unit_tests (push) Successful in 56s
Run unit tests / build-static-assets (push) Successful in 8m15s
Reviewed-on: #279
2025-06-12 17:32:27 +00:00
82a39bce82 Define a new public endpoint to get information about an invitation
All checks were successful
Run unit tests / copyright_notice (pull_request) Successful in 40s
Run unit tests / rubocop (pull_request) Successful in 52s
Run unit tests / check-licenses (pull_request) Successful in 56s
Run unit tests / unit_tests (pull_request) Successful in 1m38s
Run unit tests / build-static-assets (pull_request) Successful in 8m29s
2025-06-12 19:21:53 +02:00
3 changed files with 17 additions and 4 deletions

View File

@ -6,6 +6,9 @@ require 'csv'
class GuestsController < ApplicationController
GUEST_PARAMS = { only: %i[id name status], include: { group: { only: %i[id name] } } }.freeze
skip_before_action :authenticate_user!, only: :update
def index
render json: Guest.includes(:group)
.left_joins(:group)
@ -31,6 +34,6 @@ class GuestsController < ApplicationController
private
def guest_params
params.expect(guest: %i[name group_id status])
user_signed_in? ? params.expect(guest: %i[name group_id status]) : params.expect(guest: %i[status])
end
end

View File

@ -2,9 +2,9 @@
# frozen_string_literal: true
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
class InvitationsController < ApplicationController
skip_before_action :authenticate_user!, only: :show
def index
render json: Invitation.includes(:guests).as_json(
only: :id,
@ -16,6 +16,16 @@ 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] } }, 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[index create update destroy]
resources :invitations, only: %i[show index create update destroy]
root to: redirect("/%{slug}")
end