wolf_core 1.0.24 → 1.0.26

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: 1a5f41a88e4d5a17c5855a158c60318c7ac181f3b7ad68bc9a99501b2d41effd
4
- data.tar.gz: '082a526b1257d59ca18c22d0d7d5f6dd256de9505b4bd9f71657069cc977f4ac'
3
+ metadata.gz: f5eacee11e0130372df32b878a83782d66062d28e71aaf96162022bbdfd263eb
4
+ data.tar.gz: c8bc8ae122582cc6b5a33a973fa5ca994456c65c91d7f80414f73a4e1ec4a75b
5
5
  SHA512:
6
- metadata.gz: a644e003ecd1e09d77781f85ddeeca175db7e641390d08f1899a069dd22999085d20302d81ed377dca99cb2842f5f10628270dfa208f635f6dba30c6977fff72
7
- data.tar.gz: 27f02585960dc0c3559a00ef5e1297539532e939a36ebbb094681d8df405adf275293652c0fd8fd028f9cf4978af2cbb356a82fa58fa37c6f57e9a11ba395e9c
6
+ metadata.gz: 42b1f4bfc7024abf9382bf64feea326145454c720d66b10e5e9852461ac63445f671f26045ca6fd92d4805b9075ff471b1682c85a8fd847d408cce84cbefc45e
7
+ data.tar.gz: 98da5c9a9efa6c532c7e6990b30e4becaeb0e6edb8d167eef20e625ffe7c45899464262d93a441de33066b9a867832efed232476f2b38f6fa284c81e5df07339
@@ -14,7 +14,7 @@ module WolfCore # rubocop:disable Style/FrozenStringLiteralComment
14
14
  end
15
15
 
16
16
  def create_match(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:)
17
- http_get(
17
+ parsed_http_post(
18
18
  headers: { "Authorization" => "Bearer #{erecruit_token}" },
19
19
  url: "#{erecruit_platform_url}/",
20
20
  query: { tenant: tenant }
@@ -22,7 +22,7 @@ module WolfCore # rubocop:disable Style/FrozenStringLiteralComment
22
22
  end
23
23
 
24
24
  def update_match!(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:, error_message:)
25
- response = safe_http_post(
25
+ response = safe_http_put(
26
26
  headers: { "Authorization" => "Bearer #{erecruit_token}" },
27
27
  url: "#{erecruit_platform_url}/",
28
28
  query: { tenant: tenant },
@@ -32,7 +32,7 @@ module WolfCore # rubocop:disable Style/FrozenStringLiteralComment
32
32
  end
33
33
 
34
34
  def update_match(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:)
35
- response = http_get(
35
+ response = parsed_http_put(
36
36
  headers: { "Authorization" => "Bearer #{erecruit_token}" },
37
37
  url: "#{erecruit_platform_url}/",
38
38
  query: { tenant: tenant }
@@ -3,42 +3,41 @@ module WolfCore
3
3
  module PositionsOperations
4
4
  include WolfCore::HttpOperations
5
5
 
6
- def create_position!(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:, error_message:)
6
+ def create_position!(erecruit_token:, erecruit_platform_url:, position:, error_message:, error_data: nil)
7
7
  response = safe_http_post(
8
8
  headers: { "Authorization" => "Bearer #{erecruit_token}" },
9
- url: "#{erecruit_platform_url}/",
10
- query: { tenant: tenant },
11
- error_message: error_message
9
+ url: "#{erecruit_platform_url}/Position",
10
+ body: position,
11
+ error_message: error_message,
12
+ error_data: error_data
12
13
  )
13
- nil if response.code == 200
14
+ response.body
14
15
  end
15
16
 
16
- def create_position(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:)
17
- response = http_get(
17
+ def create_position(erecruit_token:, erecruit_platform_url:, position:)
18
+ parsed_http_post(
18
19
  headers: { "Authorization" => "Bearer #{erecruit_token}" },
19
- url: "#{erecruit_platform_url}/",
20
- query: { tenant: tenant }
20
+ url: "#{erecruit_platform_url}/Position",
21
+ body: position
21
22
  )
22
- nil if response.code == 200
23
23
  end
24
24
 
25
- def update_position!(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:, error_message:)
26
- response = safe_http_post(
25
+ def update_position!(erecruit_token:, erecruit_platform_url:, position_id:, position:, error_message:)
26
+ response = safe_http_put(
27
27
  headers: { "Authorization" => "Bearer #{erecruit_token}" },
28
- url: "#{erecruit_platform_url}/",
29
- query: { tenant: tenant },
28
+ url: "#{erecruit_platform_url}/Position/#{position_id}",
29
+ body: position,
30
30
  error_message: error_message
31
31
  )
32
- nil if response.code == 200
32
+ response.body
33
33
  end
34
34
 
35
- def update_position(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:)
36
- response = http_get(
35
+ def update_position(erecruit_token:, erecruit_platform_url:, position_id:, position:)
36
+ parsed_http_put(
37
37
  headers: { "Authorization" => "Bearer #{erecruit_token}" },
38
- url: "#{erecruit_platform_url}/",
39
- query: { tenant: tenant }
38
+ url: "#{erecruit_platform_url}/Position/#{position_id}",
39
+ body: position
40
40
  )
41
- nil if response.code == 200
42
41
  end
43
42
  end
44
43
  end
@@ -48,7 +48,7 @@ module WolfCore
48
48
  end
49
49
  end
50
50
 
51
- def safe_http_post(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil)
51
+ def safe_http_post(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil, error_data: nil)
52
52
  response = http_post(url: url, headers: headers, body: body, query: query)
53
53
  response = parse_http_response(response)
54
54
 
@@ -56,7 +56,7 @@ module WolfCore
56
56
  log_object response, title: title
57
57
 
58
58
  error_message ||= "Error on safe_http_post"
59
- validate_http_response(response: response, message: error_message)
59
+ validate_http_response(response: response, message: error_message, error_data: error_data)
60
60
 
61
61
  response
62
62
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.24"
4
+ VERSION = "1.0.26"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.24
4
+ version: 1.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo