Moved to new router style.

This commit is contained in:
Martin Edenhofer 2013-08-21 21:16:42 +02:00
parent 0eccb81fbc
commit 04854f8b07
30 changed files with 240 additions and 298 deletions

View file

@ -82,5 +82,8 @@ module Zammad
# Enable threaded mode
config.threadsafe!
# catch all router files
config.paths['config/routes'] += Dir[Rails.root.join("config/routes/*.rb")]
end
end

View file

@ -8,11 +8,4 @@ Zammad::Application.routes.draw do
# just remember to delete public/index.html.
root :to => 'init#index', :via => :get
# load routes from external files
dir = File.expand_path('../', __FILE__)
files = Dir.glob( "#{dir}/routes/*.rb" )
for file in files
load file
ExtraRoutes.add(self, Rails.configuration.api_path)
end
end
end

View file

@ -1,8 +1,6 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
map.match api_path + '/activity_stream', :to => 'activity#activity_stream', :via => :get
match api_path + '/activity_stream', :to => 'activity#activity_stream', :via => :get
end
module_function :add
end
end

View file

@ -1,19 +1,18 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# omniauth
map.match '/auth/:provider/callback', :to => 'sessions#create_omniauth',:via => [:post, :get, :puts, :delete]
# omniauth
match '/auth/:provider/callback', :to => 'sessions#create_omniauth',:via => [:post, :get, :puts, :delete]
# sso
map.match '/auth/sso', :to => 'sessions#create_sso', :via => [:post, :get]
# sso
match '/auth/sso', :to => 'sessions#create_sso', :via => [:post, :get]
# sessions
map.match api_path + '/signin', :to => 'sessions#create', :via => :post
map.match api_path + '/signshow', :to => 'sessions#show', :via => :get
map.match api_path + '/signout', :to => 'sessions#destroy', :via => [:get, :delete]
# sessions
match api_path + '/signin', :to => 'sessions#create', :via => :post
match api_path + '/signshow', :to => 'sessions#show', :via => :get
match api_path + '/signout', :to => 'sessions#destroy', :via => [:get, :delete]
map.match api_path + '/sessions', :to => 'sessions#list', :via => :get
map.match api_path + '/sessions/:id', :to => 'sessions#delete', :via => :delete
end
module_function :add
end
match api_path + '/sessions', :to => 'sessions#list', :via => :get
match api_path + '/sessions/:id', :to => 'sessions#delete', :via => :delete
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# channels
map.match api_path + '/channels', :to => 'channels#index', :via => :get
map.match api_path + '/channels/:id', :to => 'channels#show', :via => :get
map.match api_path + '/channels', :to => 'channels#create', :via => :post
map.match api_path + '/channels/:id', :to => 'channels#update', :via => :put
map.match api_path + '/channels/:id', :to => 'channels#destroy', :via => :delete
# channels
match api_path + '/channels', :to => 'channels#index', :via => :get
match api_path + '/channels/:id', :to => 'channels#show', :via => :get
match api_path + '/channels', :to => 'channels#create', :via => :post
match api_path + '/channels/:id', :to => 'channels#update', :via => :put
match api_path + '/channels/:id', :to => 'channels#destroy', :via => :delete
end
module_function :add
end

View file

@ -1,12 +1,10 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# groups
map.match api_path + '/email_addresses', :to => 'email_addresses#index', :via => :get
map.match api_path + '/email_addresses/:id', :to => 'email_addresses#show', :via => :get
map.match api_path + '/email_addresses', :to => 'email_addresses#create', :via => :post
map.match api_path + '/email_addresses/:id', :to => 'email_addresses#update', :via => :put
# groups
match api_path + '/email_addresses', :to => 'email_addresses#index', :via => :get
match api_path + '/email_addresses/:id', :to => 'email_addresses#show', :via => :get
match api_path + '/email_addresses', :to => 'email_addresses#create', :via => :post
match api_path + '/email_addresses/:id', :to => 'email_addresses#update', :via => :put
end
module_function :add
end

View file

@ -1,9 +1,7 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# getting_started
map.match api_path + '/getting_started', :to => 'getting_started#index', :via => :get
# getting_started
match api_path + '/getting_started', :to => 'getting_started#index', :via => :get
end
module_function :add
end
end

View file

@ -1,12 +1,10 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# groups
map.match api_path + '/groups', :to => 'groups#index', :via => :get
map.match api_path + '/groups/:id', :to => 'groups#show', :via => :get
map.match api_path + '/groups', :to => 'groups#create', :via => :post
map.match api_path + '/groups/:id', :to => 'groups#update', :via => :put
# groups
match api_path + '/groups', :to => 'groups#index', :via => :get
match api_path + '/groups/:id', :to => 'groups#show', :via => :get
match api_path + '/groups', :to => 'groups#create', :via => :post
match api_path + '/groups/:id', :to => 'groups#update', :via => :put
end
module_function :add
end

View file

@ -1,11 +1,9 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# links
map.match api_path + '/links', :to => 'links#index', :via => :get
map.match api_path + '/links/add', :to => 'links#add', :via => :get
map.match api_path + '/links/remove', :to => 'links#remove', :via => :get
# links
match api_path + '/links', :to => 'links#index', :via => :get
match api_path + '/links/add', :to => 'links#add', :via => :get
match api_path + '/links/remove', :to => 'links#remove', :via => :get
end
module_function :add
end
end

View file

@ -1,10 +1,8 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# messages
map.match api_path + '/message_send', :to => 'long_polling#message_send', :via => [ :get, :post ]
map.match api_path + '/message_receive', :to => 'long_polling#message_receive', :via => [ :get, :post ]
# messages
match api_path + '/message_send', :to => 'long_polling#message_send', :via => [ :get, :post ]
match api_path + '/message_receive', :to => 'long_polling#message_receive', :via => [ :get, :post ]
end
module_function :add
end
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# networkss
map.match api_path + '/networks', :to => 'networks#index', :via => :get
map.match api_path + '/networks/:id', :to => 'networks#show', :via => :get
map.match api_path + '/networks', :to => 'networks#create', :via => :post
map.match api_path + '/networks/:id', :to => 'networks#update', :via => :put
map.match api_path + '/networks/:id', :to => 'networks#destroy',:via => :delete
# networkss
match api_path + '/networks', :to => 'networks#index', :via => :get
match api_path + '/networks/:id', :to => 'networks#show', :via => :get
match api_path + '/networks', :to => 'networks#create', :via => :post
match api_path + '/networks/:id', :to => 'networks#update', :via => :put
match api_path + '/networks/:id', :to => 'networks#destroy',:via => :delete
end
module_function :add
end

View file

@ -1,12 +1,10 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# organizations
map.match api_path + '/organizations', :to => 'organizations#index', :via => :get
map.match api_path + '/organizations/:id', :to => 'organizations#show', :via => :get
map.match api_path + '/organizations', :to => 'organizations#create', :via => :post
map.match api_path + '/organizations/:id', :to => 'organizations#update', :via => :put
# organizations
match api_path + '/organizations', :to => 'organizations#index', :via => :get
match api_path + '/organizations/:id', :to => 'organizations#show', :via => :get
match api_path + '/organizations', :to => 'organizations#create', :via => :post
match api_path + '/organizations/:id', :to => 'organizations#update', :via => :put
end
module_function :add
end
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# overviews
map.match api_path + '/overviews', :to => 'overviews#index', :via => :get
map.match api_path + '/overviews/:id', :to => 'overviews#show', :via => :get
map.match api_path + '/overviews', :to => 'overviews#create', :via => :post
map.match api_path + '/overviews/:id', :to => 'overviews#update', :via => :put
map.match api_path + '/overviews/:id', :to => 'overviews#destroy', :via => :delete
# overviews
match api_path + '/overviews', :to => 'overviews#index', :via => :get
match api_path + '/overviews/:id', :to => 'overviews#show', :via => :get
match api_path + '/overviews', :to => 'overviews#create', :via => :post
match api_path + '/overviews/:id', :to => 'overviews#update', :via => :put
match api_path + '/overviews/:id', :to => 'overviews#destroy', :via => :delete
end
module_function :add
end

View file

@ -1,11 +1,9 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# overviews
map.match api_path + '/packages', :to => 'packages#index', :via => :get
map.match api_path + '/packages', :to => 'packages#install', :via => :post
map.match api_path + '/packages', :to => 'packages#uninstall', :via => :delete
# overviews
match api_path + '/packages', :to => 'packages#index', :via => :get
match api_path + '/packages', :to => 'packages#install', :via => :post
match api_path + '/packages', :to => 'packages#uninstall', :via => :delete
end
module_function :add
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# postmaster_filters
map.match api_path + '/postmaster_filters', :to => 'postmaster_filters#index', :via => :get
map.match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#show', :via => :get
map.match api_path + '/postmaster_filters', :to => 'postmaster_filters#create', :via => :post
map.match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#update', :via => :put
map.match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#destroy', :via => :delete
# postmaster_filters
match api_path + '/postmaster_filters', :to => 'postmaster_filters#index', :via => :get
match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#show', :via => :get
match api_path + '/postmaster_filters', :to => 'postmaster_filters#create', :via => :post
match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#update', :via => :put
match api_path + '/postmaster_filters/:id', :to => 'postmaster_filters#destroy', :via => :delete
end
module_function :add
end

View file

@ -1,8 +1,5 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
map.match api_path + '/recent_viewed', :to => 'recent_viewed#recent_viewed', :via => :get
end
module_function :add
end
match api_path + '/recent_viewed', :to => 'recent_viewed#recent_viewed', :via => :get
end

View file

@ -1,12 +1,10 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# roles
map.match api_path + '/roles', :to => 'roles#index', :via => :get
map.match api_path + '/roles/:id', :to => 'roles#show', :via => :get
map.match api_path + '/roles', :to => 'roles#create', :via => :post
map.match api_path + '/roles/:id', :to => 'roles#update', :via => :put
# roles
match api_path + '/roles', :to => 'roles#index', :via => :get
match api_path + '/roles/:id', :to => 'roles#show', :via => :get
match api_path + '/roles', :to => 'roles#create', :via => :post
match api_path + '/roles/:id', :to => 'roles#update', :via => :put
end
module_function :add
end

View file

@ -1,9 +1,7 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# rss
map.match api_path + '/rss_fetch', :to => 'rss#fetch', :via => :get
# rss
match api_path + '/rss_fetch', :to => 'rss#fetch', :via => :get
end
module_function :add
end
end

View file

@ -1,9 +1,7 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# search
map.match api_path + '/search', :to => 'search#search', :via => [:get, :post]
# search
match api_path + '/search', :to => 'search#search', :via => [:get, :post]
end
module_function :add
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# base objects
map.match api_path + '/settings', :to => 'settings#index', :via => :get
map.match api_path + '/settings/:id', :to => 'settings#show', :via => :get
map.match api_path + '/settings', :to => 'settings#create', :via => :post
map.match api_path + '/settings/:id', :to => 'settings#update', :via => :put
map.match api_path + '/settings/:id', :to => 'settings#destroy', :via => :delete
# base objects
match api_path + '/settings', :to => 'settings#index', :via => :get
match api_path + '/settings/:id', :to => 'settings#show', :via => :get
match api_path + '/settings', :to => 'settings#create', :via => :post
match api_path + '/settings/:id', :to => 'settings#update', :via => :put
match api_path + '/settings/:id', :to => 'settings#destroy', :via => :delete
end
module_function :add
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# signatures
map.match api_path + '/signatures', :to => 'signatures#index', :via => :get
map.match api_path + '/signatures/:id', :to => 'signatures#show', :via => :get
map.match api_path + '/signatures', :to => 'signatures#create', :via => :post
map.match api_path + '/signatures/:id', :to => 'signatures#update', :via => :put
map.match api_path + '/signatures/:id', :to => 'signatures#destroy', :via => :delete
# signatures
match api_path + '/signatures', :to => 'signatures#index', :via => :get
match api_path + '/signatures/:id', :to => 'signatures#show', :via => :get
match api_path + '/signatures', :to => 'signatures#create', :via => :post
match api_path + '/signatures/:id', :to => 'signatures#update', :via => :put
match api_path + '/signatures/:id', :to => 'signatures#destroy', :via => :delete
end
module_function :add
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# slas
map.match api_path + '/slas', :to => 'slas#index', :via => :get
map.match api_path + '/slas/:id', :to => 'slas#show', :via => :get
map.match api_path + '/slas', :to => 'slas#create', :via => :post
map.match api_path + '/slas/:id', :to => 'slas#update', :via => :put
map.match api_path + '/slas/:id', :to => 'slas#destroy', :via => :delete
# slas
match api_path + '/slas', :to => 'slas#index', :via => :get
match api_path + '/slas/:id', :to => 'slas#show', :via => :get
match api_path + '/slas', :to => 'slas#create', :via => :post
match api_path + '/slas/:id', :to => 'slas#update', :via => :put
match api_path + '/slas/:id', :to => 'slas#destroy', :via => :delete
end
module_function :add
end

View file

@ -1,11 +1,9 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# links
map.match api_path + '/tags', :to => 'tags#list', :via => :get
map.match api_path + '/tags/add', :to => 'tags#add', :via => :get
map.match api_path + '/tags/remove', :to => 'tags#remove', :via => :get
# links
match api_path + '/tags', :to => 'tags#list', :via => :get
match api_path + '/tags/add', :to => 'tags#add', :via => :get
match api_path + '/tags/remove', :to => 'tags#remove', :via => :get
end
module_function :add
end
end

View file

@ -1,10 +1,10 @@
module ExtraRoutes
def add(map, api_path)
map.match api_path + '/taskbar', :to => 'taskbar#index', :via => :get
map.match api_path + '/taskbar/:id', :to => 'taskbar#show', :via => :get
map.match api_path + '/taskbar', :to => 'taskbar#create', :via => :post
map.match api_path + '/taskbar/:id', :to => 'taskbar#update', :via => :put
map.match api_path + '/taskbar/:id', :to => 'taskbar#destroy',:via => :delete
end
module_function :add
end
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
match api_path + '/taskbar', :to => 'taskbar#index', :via => :get
match api_path + '/taskbar/:id', :to => 'taskbar#show', :via => :get
match api_path + '/taskbar', :to => 'taskbar#create', :via => :post
match api_path + '/taskbar/:id', :to => 'taskbar#update', :via => :put
match api_path + '/taskbar/:id', :to => 'taskbar#destroy',:via => :delete
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# templates
map.match api_path + '/templates', :to => 'templates#index', :via => :get
map.match api_path + '/templates/:id', :to => 'templates#show', :via => :get
map.match api_path + '/templates', :to => 'templates#create', :via => :post
map.match api_path + '/templates/:id', :to => 'templates#update', :via => :put
map.match api_path + '/templates/:id', :to => 'templates#destroy', :via => :delete
# templates
match api_path + '/templates', :to => 'templates#index', :via => :get
match api_path + '/templates/:id', :to => 'templates#show', :via => :get
match api_path + '/templates', :to => 'templates#create', :via => :post
match api_path + '/templates/:id', :to => 'templates#update', :via => :put
match api_path + '/templates/:id', :to => 'templates#destroy', :via => :delete
end
module_function :add
end

View file

@ -1,10 +1,7 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
map.match '/tests-core', :to => 'tests#core', :via => :get
map.match '/tests-form', :to => 'tests#form', :via => :get
map.match '/tests/wait/:sec', :to => 'tests#wait', :via => :get
match '/tests-core', :to => 'tests#core', :via => :get
match '/tests-form', :to => 'tests#form', :via => :get
match '/tests/wait/:sec', :to => 'tests#wait', :via => :get
end
module_function :add
end
end

View file

@ -1,13 +1,11 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# text_modules
map.match api_path + '/text_modules', :to => 'text_modules#index', :via => :get
map.match api_path + '/text_modules/:id', :to => 'text_modules#show', :via => :get
map.match api_path + '/text_modules', :to => 'text_modules#create', :via => :post
map.match api_path + '/text_modules/:id', :to => 'text_modules#update', :via => :put
map.match api_path + '/text_modules/:id', :to => 'text_modules#destroy', :via => :delete
# text_modules
match api_path + '/text_modules', :to => 'text_modules#index', :via => :get
match api_path + '/text_modules/:id', :to => 'text_modules#show', :via => :get
match api_path + '/text_modules', :to => 'text_modules#create', :via => :post
match api_path + '/text_modules/:id', :to => 'text_modules#update', :via => :put
match api_path + '/text_modules/:id', :to => 'text_modules#destroy', :via => :delete
end
module_function :add
end

View file

@ -1,43 +1,41 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# tickets
map.match api_path + '/tickets/search', :to => 'tickets#search', :via => [:get, :post]
map.match api_path + '/tickets', :to => 'tickets#index', :via => :get
map.match api_path + '/tickets/:id', :to => 'tickets#show', :via => :get
map.match api_path + '/tickets', :to => 'tickets#create', :via => :post
map.match api_path + '/tickets/:id', :to => 'tickets#update', :via => :put
map.match api_path + '/ticket_create', :to => 'tickets#ticket_create', :via => :get
map.match api_path + '/ticket_full/:id', :to => 'tickets#ticket_full', :via => :get
map.match api_path + '/ticket_history/:id', :to => 'tickets#ticket_history', :via => :get
map.match api_path + '/ticket_customer', :to => 'tickets#ticket_customer', :via => :get
map.match api_path + '/ticket_merge_list/:ticket_id', :to => 'tickets#ticket_merge_list', :via => :get
map.match api_path + '/ticket_merge/:slave_ticket_id/:master_ticket_number', :to => 'tickets#ticket_merge', :via => :get
# tickets
match api_path + '/tickets/search', :to => 'tickets#search', :via => [:get, :post]
match api_path + '/tickets', :to => 'tickets#index', :via => :get
match api_path + '/tickets/:id', :to => 'tickets#show', :via => :get
match api_path + '/tickets', :to => 'tickets#create', :via => :post
match api_path + '/tickets/:id', :to => 'tickets#update', :via => :put
match api_path + '/ticket_create', :to => 'tickets#ticket_create', :via => :get
match api_path + '/ticket_full/:id', :to => 'tickets#ticket_full', :via => :get
match api_path + '/ticket_history/:id', :to => 'tickets#ticket_history', :via => :get
match api_path + '/ticket_customer', :to => 'tickets#ticket_customer', :via => :get
match api_path + '/ticket_merge_list/:ticket_id', :to => 'tickets#ticket_merge_list', :via => :get
match api_path + '/ticket_merge/:slave_ticket_id/:master_ticket_number', :to => 'tickets#ticket_merge', :via => :get
# ticket overviews
map.match api_path + '/ticket_overviews', :to => 'ticket_overviews#show', :via => :get
# ticket overviews
match api_path + '/ticket_overviews', :to => 'ticket_overviews#show', :via => :get
# ticket priority
map.match api_path + '/ticket_priorities', :to => 'ticket_priorities#index', :via => :get
map.match api_path + '/ticket_priorities/:id', :to => 'ticket_priorities#show', :via => :get
map.match api_path + '/ticket_priorities', :to => 'ticket_priorities#create', :via => :post
map.match api_path + '/ticket_priorities/:id', :to => 'ticket_priorities#update', :via => :put
# ticket priority
match api_path + '/ticket_priorities', :to => 'ticket_priorities#index', :via => :get
match api_path + '/ticket_priorities/:id', :to => 'ticket_priorities#show', :via => :get
match api_path + '/ticket_priorities', :to => 'ticket_priorities#create', :via => :post
match api_path + '/ticket_priorities/:id', :to => 'ticket_priorities#update', :via => :put
# ticket state
map.match api_path + '/ticket_states', :to => 'ticket_states#index', :via => :get
map.match api_path + '/ticket_states/:id', :to => 'ticket_states#show', :via => :get
map.match api_path + '/ticket_states', :to => 'ticket_states#create', :via => :post
map.match api_path + '/ticket_states/:id', :to => 'ticket_states#update', :via => :put
# ticket state
match api_path + '/ticket_states', :to => 'ticket_states#index', :via => :get
match api_path + '/ticket_states/:id', :to => 'ticket_states#show', :via => :get
match api_path + '/ticket_states', :to => 'ticket_states#create', :via => :post
match api_path + '/ticket_states/:id', :to => 'ticket_states#update', :via => :put
# ticket articles
map.match api_path + '/ticket_articles', :to => 'ticket_articles#index', :via => :get
map.match api_path + '/ticket_articles/:id', :to => 'ticket_articles#show', :via => :get
map.match api_path + '/ticket_articles', :to => 'ticket_articles#create', :via => :post
map.match api_path + '/ticket_articles/:id', :to => 'ticket_articles#update', :via => :put
map.match api_path + '/ticket_attachment/:ticket_id/:article_id/:id', :to => 'ticket_articles#attachment', :via => :get
map.match api_path + '/ticket_attachment_new', :to => 'ticket_articles#attachment_new', :via => :post
map.match api_path + '/ticket_article_plain/:id', :to => 'ticket_articles#article_plain', :via => :get
# ticket articles
match api_path + '/ticket_articles', :to => 'ticket_articles#index', :via => :get
match api_path + '/ticket_articles/:id', :to => 'ticket_articles#show', :via => :get
match api_path + '/ticket_articles', :to => 'ticket_articles#create', :via => :post
match api_path + '/ticket_articles/:id', :to => 'ticket_articles#update', :via => :put
match api_path + '/ticket_attachment/:ticket_id/:article_id/:id', :to => 'ticket_articles#attachment', :via => :get
match api_path + '/ticket_attachment_new', :to => 'ticket_articles#attachment_new', :via => :post
match api_path + '/ticket_article_plain/:id', :to => 'ticket_articles#article_plain', :via => :get
end
module_function :add
end
end

View file

@ -1,12 +1,11 @@
module ExtraRoutes
def add(map, api_path)
map.match api_path + '/translations', :to => 'translations#index', :via => :get
map.match api_path + '/translations/:id', :to => 'translations#show', :via => :get
map.match api_path + '/translations', :to => 'translations#create', :via => :post
map.match api_path + '/translations/:id', :to => 'translations#update', :via => :put
map.match api_path + '/translations/:id', :to => 'translations#destroy', :via => :delete
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
map.match api_path + '/translations/lang/:locale', :to => 'translations#load', :via => :get
end
module_function :add
end
match api_path + '/translations', :to => 'translations#index', :via => :get
match api_path + '/translations/:id', :to => 'translations#show', :via => :get
match api_path + '/translations', :to => 'translations#create', :via => :post
match api_path + '/translations/:id', :to => 'translations#update', :via => :put
match api_path + '/translations/:id', :to => 'translations#destroy', :via => :delete
match api_path + '/translations/lang/:locale', :to => 'translations#load', :via => :get
end

View file

@ -1,18 +1,16 @@
module ExtraRoutes
def add(map, api_path)
Zammad::Application.routes.draw do
api_path = Rails.configuration.api_path
# users
map.match api_path + '/users/search', :to => 'users#search', :via => [:get, :post]
map.match api_path + '/users/password_reset', :to => 'users#password_reset_send', :via => :post
map.match api_path + '/users/password_reset_verify', :to => 'users#password_reset_verify', :via => :post
map.match api_path + '/users/password_change', :to => 'users#password_change', :via => :post
map.match api_path + '/users/preferences', :to => 'users#preferences', :via => :put
map.match api_path + '/users/account', :to => 'users#account_remove', :via => :delete
map.match api_path + '/users', :to => 'users#index', :via => :get
map.match api_path + '/users/:id', :to => 'users#show', :via => :get
map.match api_path + '/users', :to => 'users#create', :via => :post
map.match api_path + '/users/:id', :to => 'users#update', :via => :put
# users
match api_path + '/users/search', :to => 'users#search', :via => [:get, :post]
match api_path + '/users/password_reset', :to => 'users#password_reset_send', :via => :post
match api_path + '/users/password_reset_verify', :to => 'users#password_reset_verify', :via => :post
match api_path + '/users/password_change', :to => 'users#password_change', :via => :post
match api_path + '/users/preferences', :to => 'users#preferences', :via => :put
match api_path + '/users/account', :to => 'users#account_remove', :via => :delete
match api_path + '/users', :to => 'users#index', :via => :get
match api_path + '/users/:id', :to => 'users#show', :via => :get
match api_path + '/users', :to => 'users#create', :via => :post
match api_path + '/users/:id', :to => 'users#update', :via => :put
end
module_function :add
end