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()
|
||||
@urlStatus.attr('data-state', '')
|
||||
url = @zendeskUrl.val() + '/agent/admin/api'
|
||||
@zendeskUrlApiToken.attr('href', url.replace('//', '/'))
|
||||
@zendeskUrlApiToken.attr('href', url.replace(/[^:]\/\//, '/'))
|
||||
@zendeskUrlApiToken.val('HERE')
|
||||
@$('[data-slide=zendesk-url]').toggleClass('hide')
|
||||
@$('[data-slide=zendesk-credentials]').toggleClass('hide')
|
||||
|
|
|
@ -50,7 +50,7 @@ class ImportZendeskController < ApplicationController
|
|||
end
|
||||
|
||||
endpoint = "#{params[:url]}/api/v2"
|
||||
endpoint.gsub('//', '/')
|
||||
endpoint.gsub(%r{[^:]//}, '/')
|
||||
Setting.set('import_zendesk_endpoint', endpoint)
|
||||
|
||||
render json: {
|
||||
|
|
Loading…
Reference in a new issue