Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/getstream_ruby/extensions/moderation_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ class ModerationClient
# @param profile [Hash] Profile data to be checked
# @option profile [String] :username Username to be checked
# @option profile [String] :image Image URL to be checked
# @param config_key [String] Moderation config key to use (defaults to 'user_profile:default').
# @return [Models::CheckResponse]
#
# @example
# client.moderation.check_user_profile('user-id',
# { username: 'bad_username', image: 'https://example.com/profile.jpg' })
def check_user_profile(user_id, profile)
def check_user_profile(user_id, profile, config_key: 'user_profile:default')
if profile[:username].nil? && profile[:image].nil?
raise ArgumentError, 'Either username or image must be provided'
end
Expand All @@ -38,7 +39,7 @@ def check_user_profile(user_id, profile)
entity_id: user_id,
entity_creator_id: user_id,
moderation_payload: moderation_payload,
config_key: 'user_profile:default',
config_key: config_key,
options: { force_sync: true, test_mode: true },
)

Expand Down
Loading