Add edit_key to Parties output on create

We create a new view `created` that includes the `full` view but adds the `edit_key` param
This commit is contained in:
Justin Edmund 2023-01-31 00:29:29 -08:00
parent c4ae38a432
commit bedd72a753
2 changed files with 6 additions and 1 deletions

View file

@ -86,6 +86,11 @@ module Api
include_view :preview
end
view :created do
include_view :full
fields :edit_key
end
view :destroyed do
fields :name, :description, :created_at, :updated_at
end

View file

@ -26,7 +26,7 @@ module Api
# end
if party.save!
return render json: PartyBlueprint.render(party, view: :full, root: :party),
return render json: PartyBlueprint.render(party, view: :created, root: :party),
status: :created
end