Refine registration endpoint #165

Merged
bustikiller merged 7 commits from remove-wedding-date into main 2024-12-07 22:45:16 +00:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 022b58bb38 - Show all commits

View File

@ -2,7 +2,7 @@
class CaptchaController < ApplicationController class CaptchaController < ApplicationController
skip_before_action :authenticate_user! skip_before_action :authenticate_user!
skip_before_action :set_tenant
def create def create
id = LibreCaptcha.new.get_id id = LibreCaptcha.new.get_id
render json: { render json: {

View File

@ -7,7 +7,7 @@ class Users::RegistrationsController < Devise::RegistrationsController
before_action :validate_captcha!, only: :create before_action :validate_captcha!, only: :create
def create def create
wedding = Wedding.create(wedding_params) wedding = Wedding.create(slug: params[:slug])
unless wedding.persisted? unless wedding.persisted?
render json: { errors: wedding.errors.full_messages }, status: :unprocessable_entity render json: { errors: wedding.errors.full_messages }, status: :unprocessable_entity
return return
@ -22,7 +22,7 @@ class Users::RegistrationsController < Devise::RegistrationsController
private private
def wedding_params def set_tenant
{ slug: params[:slug], **params.expect(wedding: :date) } set_current_tenant(nil)
end end
end end