Skip to content

Commit 955640c

Browse files
committed
add remove batch tags method
1 parent e14acb0 commit 955640c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/imagekitio/client.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ def bulk_tags_add(file_ids = [], tags = [])
108108
@file.batch_tags_add(file_ids, tags)
109109
end
110110

111+
def bulk_tags_remove(file_ids = [], tags = [])
112+
@file.batch_tags_remove(file_ids, tags)
113+
end
114+
111115
def phash_distance(first, second)
112116
# Get hamming distance between two phash(image hash) to check
113117
# similarity between images

lib/imagekitio/file.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,16 @@ def stream_file(remote_file_url, &block)
124124
@req_obj.request_stream('get', remote_file_url, headers: @req_obj.create_headers, &block)
125125
end
126126

127-
def bulk_tags_add(file_ids, tags)
127+
def batch_tags_add(file_ids, tags)
128128
url = "#{constants.BASE_URL}/addTags"
129129
payload = { 'fileIds': file_ids, tags: tags }
130130
@req_obj.request('post', url, @req_obj.create_headers, payload)
131+
end
131132

133+
def batch_tags_remove(file_ids, tags)
134+
url = "#{constants.BASE_URL}/removeTags"
135+
payload = { 'fileIds': file_ids, tags: tags }
136+
@req_obj.request('post', url, @req_obj.create_headers, payload)
132137
end
133138

134139
def validate_upload_options(options)

0 commit comments

Comments
 (0)