Browse Source

Added config option for REST api base path on server and on site client. Currently on both "/api/v1" is used.

Martin Edenhofer 11 years ago
parent
commit
59c4f77e3e

+ 1 - 0
app/assets/javascripts/app/config.js.coffee

@@ -0,0 +1 @@
+App.Config.set('api_path', 'api/v1')

+ 1 - 1
app/assets/javascripts/app/controllers/_application_controller.js.coffee

@@ -375,7 +375,7 @@ class App.Controller extends Spine.Controller
     tickets = {}
     App.Com.ajax(
       type:  'GET',
-      url:   'api/ticket_customer',
+      url:   @Config.get('api_path') + '/ticket_customer',
       data:  {
         customer_id: data.user_id,
       }

+ 1 - 1
app/assets/javascripts/app/controllers/_application_controller_form.js.coffee

@@ -358,7 +358,7 @@ class App.ControllerForm extends App.Controller
         u = =>
           @el.find('#' + fileUploaderId ).fineUploader(
             request:
-              endpoint: 'api/ticket_attachment_new'
+              endpoint: App.Config.get('api_path') + '/ticket_attachment_new'
               params:
                 form_id: @form_id
             text:

+ 1 - 1
app/assets/javascripts/app/controllers/_dashboard/activity_stream.js.coffee

@@ -23,7 +23,7 @@ class App.DashboardActivityStream extends App.Controller
       App.Com.ajax(
         id:    'dashoard_activity_stream'
         type:  'GET'
-        url:   'api/activity_stream'
+        url:   @Config.get('api_path') + '/activity_stream'
         data:  {
           limit: 8
         }

+ 1 - 1
app/assets/javascripts/app/controllers/_dashboard/recent_viewed.js.coffee

@@ -11,7 +11,7 @@ class App.DashboardRecentViewed extends App.Controller
     App.Com.ajax(
       id:    'dashboard_recent_viewed',
       type:  'GET',
-      url:   'api/recent_viewed',
+      url:   @Config.get('api_path') + '/recent_viewed',
       data:  {
         limit: 5,
       }

+ 1 - 1
app/assets/javascripts/app/controllers/_dashboard/rss.js.coffee

@@ -21,7 +21,7 @@ class App.DashboardRss extends App.Controller
       App.Com.ajax(
         id:    'dashboard_rss'
         type:  'GET'
-        url:   'api/rss_fetch'
+        url:   @Config.get('api_path') + '/rss_fetch'
         data:  {
           limit: 8
           url:   'http://www.heise.de/newsticker/heise-atom.xml'

+ 1 - 1
app/assets/javascripts/app/controllers/_dashboard/ticket.js.coffee

@@ -30,7 +30,7 @@ class App.DashboardTicket extends App.Controller
       App.Com.ajax(
         id:    'dashboard_ticket_' + @key,
         type:  'GET',
-        url:   'api/ticket_overviews',
+        url:   @Config.get('api_path') + '/ticket_overviews',
         data:  {
           view:       @view,
           view_mode:  'd',

+ 1 - 1
app/assets/javascripts/app/controllers/_profile/language.js.coffee

@@ -37,7 +37,7 @@ class App.ProfileLanguage extends App.Controller
     App.Com.ajax(
       id:   'preferences'
       type: 'PUT'
-      url:  'api/users/preferences'
+      url:  @Config.get('api_path') + '/users/preferences'
       data: JSON.stringify(params)
       processData: true
       success: @success

+ 1 - 1
app/assets/javascripts/app/controllers/_profile/linked_accounts.js.coffee

@@ -53,7 +53,7 @@ class App.ProfileLinkedAccounts extends App.Controller
     App.Com.ajax(
       id:   'account'
       type: 'DELETE'
-      url:  'api/users/account'
+      url:  @Config.get('api_path') + '/users/account'
       data: JSON.stringify({ provider: provider, uid: uid })
       processData: true
       success: @success

+ 1 - 1
app/assets/javascripts/app/controllers/_profile/password.js.coffee

@@ -38,7 +38,7 @@ class App.ProfilePassword extends App.Controller
     App.Com.ajax(
       id:   'password_reset'
       type: 'POST'
-      url:  'api/users/password_change'
+      url:  @Config.get('api_path') + '/users/password_change'
       data: JSON.stringify(params)
       processData: true
       success: @success

Some files were not shown because too many files changed in this diff