lib/osso/graphql/mutations/regenerate_oauth_credentials.rb in osso-0.0.10 vs lib/osso/graphql/mutations/regenerate_oauth_credentials.rb in osso-0.0.11
- old
+ new
@@ -13,10 +13,13 @@
def resolve(id:)
oauth_client = Osso::Models::OauthClient.find(id)
oauth_client.regenerate_secrets!
- return response_data(oauth_client: oauth_client) if oauth_client.save
+ if oauth_client.save
+ Osso::Analytics.capture(email: context[:email], event: self.class.name.demodulize, properties: { oauth_client_id: id })
+ return response_data(oauth_client: oauth_client)
+ end
response_error(oauth_client.errors)
end
def ready?(*)