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 {
8282 RefreshCdn
8383 } = camelCaseProperty ( inputs )
8484
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+
8599 const cdnInputs = flushEmptyValue ( {
86100 Domain,
87101 Origin : formatOrigin ( Origin ) ,
@@ -140,18 +154,6 @@ class Cdn {
140154
141155 const cdnInfo = await getCdnByDomain ( this . capi , Domain )
142156
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-
155157 const sourceInputs = JSON . parse ( JSON . stringify ( cdnInputs ) )
156158
157159 const createOrUpdateCdn = async ( ) => {
You can’t perform that action at this time.
0 commit comments