webflow_sync 6.0.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/webflow_sync/api.rb +7 -5
- data/lib/webflow_sync/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf8a9fdd99e65667dad7f82bd2e5eb7539999a3c48a363cfd8f68b1217b6bb84
|
4
|
+
data.tar.gz: e7aa812fd99148cf99cd41b5c999414d356dd2384e59cc610de61a73d7a3ecf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ad5b0d2e7fb1724ab309f96630e3653dfe3b4419365b2131af623ec324b05b47e4a65275f977fc5a42744f12630892659bce92053de065d5cc92ebc2f2cc58a
|
7
|
+
data.tar.gz: b61fdc179fcc31af51ab45180eec3f108e842e3b92870463e5602515b470a6c5956a3d1825f7c37dc99e513322d76d615d30d957344a191d45018893b4c5873d
|
@@ -80,6 +80,8 @@ module WebflowSync
|
|
80
80
|
response
|
81
81
|
end
|
82
82
|
|
83
|
+
def sites = make_request(:sites)
|
84
|
+
|
83
85
|
private
|
84
86
|
|
85
87
|
def client
|
@@ -87,7 +89,7 @@ module WebflowSync
|
|
87
89
|
end
|
88
90
|
|
89
91
|
def collections
|
90
|
-
@collections ||=
|
92
|
+
@collections ||= make_request(:collections, site_id)
|
91
93
|
end
|
92
94
|
|
93
95
|
def domain_names
|
@@ -98,16 +100,16 @@ module WebflowSync
|
|
98
100
|
# client.domains request does not return the default domain
|
99
101
|
# We need to get default domain name if there are no custom domains set to avoid error:
|
100
102
|
# Webflow::Error: Domain not found for site
|
101
|
-
site =
|
102
|
-
default_domain_name = "#{site
|
103
|
+
site = make_request(:site, site_id)
|
104
|
+
default_domain_name = "#{site.fetch('shortName')}.webflow.io"
|
103
105
|
names = [default_domain_name]
|
104
|
-
|
106
|
+
make_request(:domains, site_id).each { |domain| names << domain.fetch('name') }
|
105
107
|
|
106
108
|
names
|
107
109
|
end
|
108
110
|
|
109
111
|
def find_webflow_collection(collection_slug)
|
110
|
-
response = collections.find { |collection| collection
|
112
|
+
response = collections.find { |collection| collection.fetch('slug') == collection_slug }
|
111
113
|
raise "Cannot find collection #{collection_slug} for Webflow site #{site_id}" unless response
|
112
114
|
|
113
115
|
response
|
data/lib/webflow_sync/version.rb
CHANGED