From 3f979f6d62a3f09b77947712930b5d9cdfee0773 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 26 Feb 2022 19:29:19 -0800 Subject: [PATCH] Add endpoint for getting all parties No filters yet --- app/controllers/api/v1/parties_controller.rb | 5 +++++ app/views/api/v1/parties/all.json.rabl | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 app/views/api/v1/parties/all.json.rabl diff --git a/app/controllers/api/v1/parties_controller.rb b/app/controllers/api/v1/parties_controller.rb index 42fba29..35bc48e 100644 --- a/app/controllers/api/v1/parties_controller.rb +++ b/app/controllers/api/v1/parties_controller.rb @@ -53,6 +53,11 @@ class Api::V1::PartiesController < Api::V1::ApiController render :characters, status: :ok end + def all + @parties = Party.all() + render :all, status: :ok + end + private def random_string diff --git a/app/views/api/v1/parties/all.json.rabl b/app/views/api/v1/parties/all.json.rabl new file mode 100644 index 0000000..5afe05e --- /dev/null +++ b/app/views/api/v1/parties/all.json.rabl @@ -0,0 +1,3 @@ +collection @parties + +extends 'parties/base'