mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 19:27:52 +01:00
Form refactoring (#142)
This commit is contained in:
committed by
GitHub
parent
d078e659c6
commit
9592ac3d1d
@@ -47,6 +47,18 @@ class TenantsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
# Given a new_subdomain
|
||||
# Returns true if it is available, false otherwise
|
||||
def is_available
|
||||
subdomain = params[:new_subdomain]
|
||||
|
||||
return unless subdomain.present?
|
||||
return if RESERVED_SUBDOMAINS.include?(subdomain)
|
||||
return if Tenant.exists?(subdomain: subdomain)
|
||||
|
||||
render json: { is_available: 'true' }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def tenant_create_params
|
||||
|
||||
Reference in New Issue
Block a user