From 7576686083dfee0277bdf2ae9443c3cc30af170b Mon Sep 17 00:00:00 2001 From: Roy Kaldung Date: Wed, 9 Jan 2013 19:13:29 +0100 Subject: [PATCH 1/2] Update app/controllers/tickets_controller.rb added missing /api prefix to documented REST URIs --- app/controllers/tickets_controller.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index b59aaaf27..5da2c24ab 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -1,14 +1,14 @@ class TicketsController < ApplicationController before_filter :authentication_check - # GET /tickets + # GET /api/tickets def index @tickets = Ticket.all render :json => @tickets end - # GET /tickets/1 + # GET /api/tickets/1 def show @ticket = Ticket.find( params[:id] ) @@ -18,7 +18,7 @@ class TicketsController < ApplicationController render :json => @ticket end - # POST /tickets + # POST /api/tickets def create @ticket = Ticket.new( params[:ticket] ) @ticket.updated_by_id = current_user.id @@ -82,7 +82,7 @@ class TicketsController < ApplicationController render :json => @ticket, :status => :created end - # PUT /tickets/1 + # PUT /api/tickets/1 def update @ticket = Ticket.find(params[:id]) @@ -98,7 +98,7 @@ class TicketsController < ApplicationController end end - # DELETE /tickets/1 + # DELETE /api/tickets/1 def destroy @ticket = Ticket.find( params[:id] ) @@ -110,8 +110,8 @@ class TicketsController < ApplicationController head :ok end - # GET /ticket_customer - # GET /tickets_customer + # GET /api/ticket_customer + # GET /api/tickets_customer def ticket_customer # get closed/open states @@ -167,7 +167,7 @@ class TicketsController < ApplicationController } end - # GET /ticket_history/1 + # GET /api/ticket_history/1 def ticket_history # get ticket data @@ -208,7 +208,7 @@ class TicketsController < ApplicationController } end - # GET /ticket_merge_list/1 + # GET /api/ticket_merge_list/1 def ticket_merge_list # get closed/open states From 489bfd467eb7ac3b7132ffd97e0bf369d6e5010e Mon Sep 17 00:00:00 2001 From: Roy Kaldung Date: Wed, 9 Jan 2013 19:14:09 +0100 Subject: [PATCH 2/2] Update app/controllers/tickets_controller.rb removed unused code, we're using a vcs ;-) --- app/controllers/tickets_controller.rb | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/app/controllers/tickets_controller.rb b/app/controllers/tickets_controller.rb index 5da2c24ab..a33e7f6c9 100644 --- a/app/controllers/tickets_controller.rb +++ b/app/controllers/tickets_controller.rb @@ -133,30 +133,6 @@ class TicketsController < ApplicationController :ticket_state_id => ticket_state_list_closed ).limit(15).order('created_at DESC') -# tickets = Ticket.where(:customer_id => user_id).limit(15).order('created_at DESC') -# ticket_items = [] -# tickets.each do |ticket| -# style = '' -# ticket_state_type = ticket.ticket_state.ticket_state_type.name -# if ticket_state_type == 'closed' || ticket_state_type == 'merged' -# style = 'text-decoration: line-through' -# end -# item = { -# :url => '#ticket/zoom/' + ticket.id.to_s, -# :name => 'T:' + ticket.number.to_s, -# :title => ticket.title, -# :style => style -# } -# ticket_items.push item -# end -# if ticket_items[0] -# topic = { -# :title => 'Tickets', -# :items => ticket_items -# } -# user['links'].push topic -# end - # return result render :json => { :tickets => {