Skip to content

Commit e623ae6

Browse files
authored
Merge pull request #67 from GetStream/chore/custom-config-key-user-profile-check
fix: allow custom config_key in check_user_profile
2 parents b76596a + 3bba6aa commit e623ae6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎lib/getstream_ruby/extensions/moderation_extensions.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ class ModerationClient
1919
# @param profile [Hash] Profile data to be checked
2020
# @option profile [String] :username Username to be checked
2121
# @option profile [String] :image Image URL to be checked
22+
# @param config_key [String] Moderation config key to use (defaults to 'user_profile:default').
2223
# @return [Models::CheckResponse]
2324
#
2425
# @example
2526
# client.moderation.check_user_profile('user-id',
2627
# { username: 'bad_username', image: 'https://example.com/profile.jpg' })
27-
def check_user_profile(user_id, profile)
28+
def check_user_profile(user_id, profile, config_key: 'user_profile:default')
2829
if profile[:username].nil? && profile[:image].nil?
2930
raise ArgumentError, 'Either username or image must be provided'
3031
end
@@ -38,7 +39,7 @@ def check_user_profile(user_id, profile)
3839
entity_id: user_id,
3940
entity_creator_id: user_id,
4041
moderation_payload: moderation_payload,
41-
config_key: 'user_profile:default',
42+
config_key: config_key,
4243
options: { force_sync: true, test_mode: true },
4344
)
4445

0 commit comments

Comments
 (0)