File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,20 @@ class Cdn {
82
82
RefreshCdn
83
83
} = camelCaseProperty ( inputs )
84
84
85
+ // only refresh cdn
86
+ if ( OnlyRefresh === true ) {
87
+ const domainExist = await getCdnByDomain ( this . capi , Domain )
88
+ // refresh cdn urls
89
+ if ( domainExist && RefreshCdn && RefreshCdn . Urls ) {
90
+ await this . purgeCdnUrls ( RefreshCdn . Urls )
91
+ }
92
+ return {
93
+ domain : Domain ,
94
+ origins : domainExist . Origin . Origins ,
95
+ refreshUrls : RefreshCdn . Urls
96
+ }
97
+ }
98
+
85
99
const cdnInputs = flushEmptyValue ( {
86
100
Domain,
87
101
Origin : formatOrigin ( Origin ) ,
@@ -140,18 +154,6 @@ class Cdn {
140
154
141
155
const cdnInfo = await getCdnByDomain ( this . capi , Domain )
142
156
143
- // only refresh cdn
144
- if ( cdnInfo && OnlyRefresh === true ) {
145
- // refresh cdn urls
146
- if ( RefreshCdn && RefreshCdn . Urls ) {
147
- await this . purgeCdnUrls ( RefreshCdn . Urls )
148
- }
149
- return {
150
- domain : Domain ,
151
- refreshUrls : RefreshCdn . Urls
152
- }
153
- }
154
-
155
157
const sourceInputs = JSON . parse ( JSON . stringify ( cdnInputs ) )
156
158
157
159
const createOrUpdateCdn = async ( ) => {
You can’t perform that action at this time.
0 commit comments