Class: Decidim::Proposals::ProposalsType

Inherits:
Api::Types::BaseObject show all
Defined in:
decidim-proposals/lib/decidim/api/proposals_type.rb

Instance Method Summary collapse

Instance Method Details

#proposal(id:) ⇒ Object


38
39
40
# File 'decidim-proposals/lib/decidim/api/proposals_type.rb', line 38

def proposal(id:)
  Decidim::Proposals::ProposalFinderHelper.new(model_class: Proposal).call(object, { id: id }, context)
end

#proposals(filter: {}, order: {}) ⇒ Object


34
35
36
# File 'decidim-proposals/lib/decidim/api/proposals_type.rb', line 34

def proposals(filter: {}, order: {})
  Decidim::Proposals::ProposalListHelper.new(model_class: Proposal).call(object, { filter: filter, order: order }, context)
end