From 18049385ceac2451fec41057dba7509cb561650a Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 23 Feb 2022 16:30:52 -0800 Subject: [PATCH] Add destroy implementation and json template --- app/controllers/api/v1/parties_controller.rb | 1 + app/views/api/v1/parties/destroyed.json.rabl | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 app/views/api/v1/parties/destroyed.json.rabl diff --git a/app/controllers/api/v1/parties_controller.rb b/app/controllers/api/v1/parties_controller.rb index 24fa4a0..50332a2 100644 --- a/app/controllers/api/v1/parties_controller.rb +++ b/app/controllers/api/v1/parties_controller.rb @@ -31,6 +31,7 @@ class Api::V1::PartiesController < Api::V1::ApiController end def destroy + render :destroyed, status: :ok if @party.destroy end def weapons diff --git a/app/views/api/v1/parties/destroyed.json.rabl b/app/views/api/v1/parties/destroyed.json.rabl new file mode 100644 index 0000000..f791b2f --- /dev/null +++ b/app/views/api/v1/parties/destroyed.json.rabl @@ -0,0 +1,5 @@ +object false + +node :destroyed do + true +end \ No newline at end of file