ticket.rb 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. Zammad::Application.routes.draw do
  3. api_path = Rails.configuration.api_path
  4. # ticket shared drafts
  5. resource api_path + '/tickets/:ticket_id/shared_draft', controller: 'ticket_shared_draft_zoom', except: %w[new edit create] do
  6. collection do
  7. post :import_attachments, as: nil
  8. end
  9. end
  10. resources api_path + '/tickets/shared_drafts', controller: 'tickets_shared_draft_starts', except: %w[new edit] do
  11. member do
  12. post :import_attachments, as: nil
  13. end
  14. end
  15. # tickets
  16. match api_path + '/tickets/search', to: 'tickets#search', via: %i[get post]
  17. match api_path + '/tickets/selector', to: 'tickets#selector', via: :post
  18. match api_path + '/tickets', to: 'tickets#index', via: :get
  19. match api_path + '/tickets/:id', to: 'tickets#show', via: :get
  20. match api_path + '/tickets', to: 'tickets#create', via: :post
  21. match api_path + '/tickets/:id', to: 'tickets#update', via: :put
  22. match api_path + '/tickets/:id', to: 'tickets#destroy', via: :delete
  23. match api_path + '/tickets/mass_macro', to: 'tickets_mass#macro', via: :post
  24. match api_path + '/tickets/mass_update', to: 'tickets_mass#update', via: :post
  25. match api_path + '/ticket_create', to: 'tickets#ticket_create', via: :get
  26. match api_path + '/ticket_split', to: 'tickets#ticket_split', via: :get
  27. match api_path + '/ticket_history/:id', to: 'tickets#ticket_history', via: :get
  28. match api_path + '/ticket_customer', to: 'tickets#ticket_customer', via: :get
  29. match api_path + '/ticket_related/:ticket_id', to: 'tickets#ticket_related', via: :get
  30. match api_path + '/ticket_recent', to: 'tickets#ticket_recent', via: :get
  31. match api_path + '/ticket_merge/:source_ticket_id/:target_ticket_number', to: 'tickets#ticket_merge', via: :put
  32. match api_path + '/ticket_stats', to: 'tickets#stats', via: %i[get post]
  33. # ticket overviews
  34. match api_path + '/ticket_overview', to: 'ticket_overviews#data', via: :get
  35. match api_path + '/ticket_overviews', to: 'ticket_overviews#show', via: :get
  36. # ticket priority
  37. match api_path + '/ticket_priorities', to: 'ticket_priorities#index', via: :get
  38. match api_path + '/ticket_priorities/:id', to: 'ticket_priorities#show', via: :get
  39. match api_path + '/ticket_priorities', to: 'ticket_priorities#create', via: :post
  40. match api_path + '/ticket_priorities/:id', to: 'ticket_priorities#update', via: :put
  41. match api_path + '/ticket_priorities/:id', to: 'ticket_priorities#destroy', via: :delete
  42. # ticket state
  43. match api_path + '/ticket_states', to: 'ticket_states#index', via: :get
  44. match api_path + '/ticket_states/:id', to: 'ticket_states#show', via: :get
  45. match api_path + '/ticket_states', to: 'ticket_states#create', via: :post
  46. match api_path + '/ticket_states/:id', to: 'ticket_states#update', via: :put
  47. match api_path + '/ticket_states/:id', to: 'ticket_states#destroy', via: :delete
  48. # ticket articles
  49. match api_path + '/ticket_articles', to: 'ticket_articles#index', via: :get
  50. match api_path + '/ticket_articles/:id', to: 'ticket_articles#show', via: :get
  51. match api_path + '/ticket_articles/by_ticket/:id', to: 'ticket_articles#index_by_ticket', via: :get
  52. match api_path + '/ticket_articles', to: 'ticket_articles#create', via: :post
  53. match api_path + '/ticket_articles/:id', to: 'ticket_articles#update', via: :put
  54. match api_path + '/ticket_articles/:id', to: 'ticket_articles#destroy', via: :delete
  55. match api_path + '/ticket_attachment/:ticket_id/:article_id/:id', to: 'ticket_articles#attachment', via: :get
  56. match api_path + '/ticket_attachment_upload_clone_by_article/:article_id', to: 'ticket_articles#ticket_attachment_upload_clone_by_article', via: :post
  57. match api_path + '/ticket_article_plain/:id', to: 'ticket_articles#article_plain', via: :get
  58. match api_path + '/ticket_articles/:id/retry_security_process', to: 'ticket_articles#retry_security_process', via: :post
  59. end