diff options
Diffstat (limited to 'lib/bulk_imports/common/rest/get_badges_query.rb')
-rw-r--r-- | lib/bulk_imports/common/rest/get_badges_query.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/bulk_imports/common/rest/get_badges_query.rb b/lib/bulk_imports/common/rest/get_badges_query.rb new file mode 100644 index 00000000000..60b2ebcc552 --- /dev/null +++ b/lib/bulk_imports/common/rest/get_badges_query.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module BulkImports + module Common + module Rest + module GetBadgesQuery + extend self + + def to_h(context) + resource = context.entity.pluralized_name + encoded_full_path = ERB::Util.url_encode(context.entity.source_full_path) + + { + resource: [resource, encoded_full_path, 'badges'].join('/'), + query: { + page: context.tracker.next_page + } + } + end + end + end + end +end |