dooca_commerce 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43b4d0da62e063f804c9a223ed013a18c113e1869ab1602207bf1d9cb71bb404
4
- data.tar.gz: e2c48b41fb5990d95467308cf2a5558ad31ed2817612833b4cb607744e78d721
3
+ metadata.gz: f2ef96abbacc085d54da98f7b01e7eddf76a8cf828f708c18fdca2e9ceb953c3
4
+ data.tar.gz: efffdc00fc890996eceff0c26e7a0000aab25ea28dc9c74706052642957c16a6
5
5
  SHA512:
6
- metadata.gz: 681e5bf4e585c6b013b9961508b37be6d6609a1c47ba176146288be9cea73bbac903819cd912c08e9c74ca9367638c56002a1b5efd6afd68ec564c249dfd0371
7
- data.tar.gz: db094d2bdbb06604ba0bfb84dd48330c11bd966c0c60d43481f53ad29060012027f0fa95ea1c446de19c9cb853a64cd4ac3cd5f848329e3b895fa63f2b814a4a
6
+ metadata.gz: 19b72c6b0961678d5a18289f6212b6e907e736eeebac7db58b52f6fc998569268046f8d98c62f001d477f5c533b8485e86a6877b9034566a3a5434f2e12ca531
7
+ data.tar.gz: fc70541b5c1b48a8a9ebacf5093d8106fbf9117166bcd7e21cfbed7e7305baa502dbf65ea781e8908ab0452caa5be82552baae50ca5c2aba764b54f8b228fb11
@@ -184,6 +184,18 @@ class DoocaCommerce
184
184
  handler.new(response).parse!
185
185
  end
186
186
 
187
+ def delete_image(product_id:, image_id:)
188
+ response = connection.delete("/products/#{product_id}/images/#{image_id}")
189
+
190
+ handler.new(response).parse!
191
+ end
192
+
193
+ def create_image(product_id:, body:)
194
+ response = connection.post("/products/#{product_id}/images", body.to_json)
195
+
196
+ handler.new(response).parse!
197
+ end
198
+
187
199
  private
188
200
 
189
201
  URL = "https://api.dooca.store"
@@ -28,7 +28,7 @@ class ResponseHandler
28
28
  end
29
29
 
30
30
  def payload
31
- @payload ||= JSON.parse(response.body, object_class: OpenStruct)
31
+ @payload ||= JSON.parse(response.body.presence || "{}", object_class: OpenStruct)
32
32
  end
33
33
 
34
34
  def success?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dooca_commerce
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luciano Cesar Cordeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-31 00:00:00.000000000 Z
11
+ date: 2022-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday