Class: SolidusGraphqlApi::Mutations::User::RemoveFromAddressBook
- Inherits:
-
BaseMutation
- Object
- GraphQL::Schema::RelayClassicMutation
- BaseMutation
- SolidusGraphqlApi::Mutations::User::RemoveFromAddressBook
- Defined in:
- lib/solidus_graphql_api/mutations/user/remove_from_address_book.rb
Instance Method Summary collapse
Instance Method Details
#ready? ⇒ Boolean
19 20 21 |
# File 'lib/solidus_graphql_api/mutations/user/remove_from_address_book.rb', line 19 def ready?(*) current_ability.(:remove_from_address_book, current_user) end |
#resolve(address:) ⇒ Object
13 14 15 16 17 |
# File 'lib/solidus_graphql_api/mutations/user/remove_from_address_book.rb', line 13 def resolve(address:) raise CanCan::AccessDenied unless current_user.remove_from_address_book(address.id) { user: current_user.reload } end |