# frozen_string_literal: true module Api # The UserAccounts controller. class UserAccountsController < ApplicationController def create @user_account = UserAccount.new(permitted_params) unless @user_account.save render json: { errors: @user_account.errors.full_messages }, status: :unprocessable_entity return end render json: Serializers::UserAccountSerializer.new(@user_account).serializable_hash end private def permitted_params params.require(:user_account).permit(:email, :first_name, :last_name, :password) end end end