Class: Decidim::Meetings::WithdrawMeetingType
- Inherits:
-
Api::Types::BaseMutation
- Object
- Api::Types::BaseMutation
- Decidim::Meetings::WithdrawMeetingType
- Defined in:
- lib/decidim/api/mutations/withdraw_meeting_type.rb
Instance Method Summary collapse
Instance Method Details
#authorized? ⇒ Boolean
23 24 25 26 27 |
# File 'lib/decidim/api/mutations/withdraw_meeting_type.rb', line 23 def raise Decidim::Api::Errors::MutationNotAuthorizedError, I18n.t("decidim.api.errors.unauthorized_mutation") unless super && allowed_to?(:withdraw, :meeting, object, context) true end |
#resolve ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/decidim/api/mutations/withdraw_meeting_type.rb', line 11 def resolve WithdrawMeeting.call(object, current_user) do on(:ok) do |meeting| return meeting end on(:invalid) do raise Decidim::Api::Errors::ValidationError, I18n.t("decidim.meetings.withdraw.error") end end end |