From 9a8577a2d19aa51318dce6ff9ffe1bd26f25c09e Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 28 Mar 2016 15:56:21 -0700 Subject: api: added get(:show) to identities and users, allow monitors to create/delete test & tmp users. --- app/controllers/v1/identities_controller.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/controllers/v1/identities_controller.rb (limited to 'app/controllers/v1/identities_controller.rb') diff --git a/app/controllers/v1/identities_controller.rb b/app/controllers/v1/identities_controller.rb new file mode 100644 index 0000000..1d8c542 --- /dev/null +++ b/app/controllers/v1/identities_controller.rb @@ -0,0 +1,12 @@ +module V1 + class IdentitiesController < ApiController + before_filter :token_authenticate + before_filter :require_monitor + + def show + @identity = Identity.find_by_address(params[:id]) + respond_with @identity + end + + end +end -- cgit v1.2.3 From 48acca107b9bd7a59bacb1449b042eb753e63917 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 30 Mar 2016 17:06:32 -0700 Subject: api: return proper 404 for GET /1/identities/:id.json --- app/controllers/v1/identities_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/controllers/v1/identities_controller.rb') diff --git a/app/controllers/v1/identities_controller.rb b/app/controllers/v1/identities_controller.rb index 1d8c542..4efd1f5 100644 --- a/app/controllers/v1/identities_controller.rb +++ b/app/controllers/v1/identities_controller.rb @@ -5,7 +5,11 @@ module V1 def show @identity = Identity.find_by_address(params[:id]) - respond_with @identity + if @identity + respond_with @identity + else + render_not_found + end end end -- cgit v1.2.3