Improved url error handling.
This commit is contained in:
parent
4eec956cbe
commit
dd29b0692c
2 changed files with 2 additions and 2 deletions
|
@ -117,7 +117,7 @@ class Index extends App.ControllerContent
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@urlStatus.attr('data-state', '')
|
@urlStatus.attr('data-state', '')
|
||||||
url = @zendeskUrl.val() + '/agent/admin/api'
|
url = @zendeskUrl.val() + '/agent/admin/api'
|
||||||
@zendeskUrlApiToken.attr('href', url.replace('//', '/'))
|
@zendeskUrlApiToken.attr('href', url.replace(/[^:]\/\//, '/'))
|
||||||
@zendeskUrlApiToken.val('HERE')
|
@zendeskUrlApiToken.val('HERE')
|
||||||
@$('[data-slide=zendesk-url]').toggleClass('hide')
|
@$('[data-slide=zendesk-url]').toggleClass('hide')
|
||||||
@$('[data-slide=zendesk-credentials]').toggleClass('hide')
|
@$('[data-slide=zendesk-credentials]').toggleClass('hide')
|
||||||
|
|
|
@ -50,7 +50,7 @@ class ImportZendeskController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
endpoint = "#{params[:url]}/api/v2"
|
endpoint = "#{params[:url]}/api/v2"
|
||||||
endpoint.gsub('//', '/')
|
endpoint.gsub(%r{[^:]//}, '/')
|
||||||
Setting.set('import_zendesk_endpoint', endpoint)
|
Setting.set('import_zendesk_endpoint', endpoint)
|
||||||
|
|
||||||
render json: {
|
render json: {
|
||||||
|
|
Loading…
Reference in a new issue