Class: Api::V1::PingsController

Inherits:
ApiController
  • Object
show all
Defined in:
lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb

Instance Method Summary collapse

Methods inherited from ApiController

#current_user

Methods included from Stitches::Deprecation

#deprecated, #gone!

Instance Method Details

#createObject



3
4
5
6
7
8
9
# File 'lib/stitches/generator_files/app/controllers/api/v1/pings_controller.rb', line 3

def create
  if ping_params[:error]
    render json: { errors: Stitches::Errors.new([ Stitches::Error.new(code: "test", message: ping_params[:error]) ])} , status: 422
  else
    render json: { ping: { status: "ok" } }, status: (ping_params[:status] || "201").to_i
  end
end