Class: Api::V1::IssuesController

Inherits:
BaseController show all
Defined in:
app/controllers/api/v1/issues_controller.rb

Overview

Issues API permits to access issues

Instance Method Summary collapse

Methods inherited from BaseController

#add_generic_headers!, #authenticate_api_user!, #authenticate_user_from_simple_token!, #force_json!

Methods included from CallLoggable

#log_request, #log_response

Instance Method Details

#createObject


9
10
11
12
13
14
15
16
# File 'app/controllers/api/v1/issues_controller.rb', line 9

def create
  issue = Issue.new(permitted_params)
  if issue.save
    render json: { id: issue.id }, status: :created
  else
    render json: issue.errors, status: :unprocessable_entity
  end
end

#indexObject


5
6
7
# File 'app/controllers/api/v1/issues_controller.rb', line 5

def index
  render json: Issue.order(id: :desc).limit(25), status: :ok
end