mirror of
https://github.com/wahyd4/libr-2.git
synced 2026-08-09 05:15:53 +10:00
18 lines
383 B
Ruby
18 lines
383 B
Ruby
class Api::V1::RegistrationsController < Api::V1::ApplicationController
|
|
skip_before_action :authenticate_user_from_token
|
|
|
|
respond_to :json
|
|
|
|
def create
|
|
params.permit!
|
|
user = User.new(params[:user])
|
|
if user.save
|
|
render json: user_json(user), status: :created
|
|
else
|
|
warden.custom_failure!
|
|
render json: user.errors, status: 422
|
|
end
|
|
end
|
|
|
|
end
|