@@ -126,16 +126,16 @@ export class FunctionAppService {
126
126
return this
127
127
. getClient ( context )
128
128
. execute (
129
- { resourceId : context . site . id } , /*input*/
130
- token => Observable /*query*/
129
+ { resourceId : context . site . id } , /*input*/
130
+ token => Observable /*query*/
131
131
. zip (
132
132
this . retrieveProxies ( context , token ) ,
133
133
this . _cacheService . get ( 'assets/schemas/proxies.json' , false , this . portalHeaders ( token ) ) ,
134
134
( p , s ) => ( { proxies : p , schema : s } ) )
135
135
. flatMap ( response => this . validateAndGetProxies ( response . proxies , response . schema ) ) ) ;
136
136
}
137
137
138
- private retrieveProxies ( context : FunctionAppContext , token : string ) : Observable < any > {
138
+ private retrieveProxies ( context : FunctionAppContext , token : string ) : Observable < any > {
139
139
return this . _cacheService
140
140
. get ( context . urlTemplates . proxiesJsonUrl , false , this . headers ( token ) )
141
141
. catch ( err => err . status === 404
@@ -147,8 +147,7 @@ export class FunctionAppService {
147
147
: Observable . throw ( err ) ) ;
148
148
}
149
149
150
- private validateAndGetProxies ( proxiesResponse : any , schemaResponse : any ) : Observable < ApiProxy [ ] >
151
- {
150
+ private validateAndGetProxies ( proxiesResponse : any , schemaResponse : any ) : Observable < ApiProxy [ ] > {
152
151
let proxiesJson , schemaJson ;
153
152
154
153
try {
@@ -181,7 +180,7 @@ export class FunctionAppService {
181
180
} ) ;
182
181
}
183
182
}
184
-
183
+
185
184
return Observable . of ( ApiProxy . fromJson ( proxiesJson ) ) ;
186
185
}
187
186
@@ -431,14 +430,13 @@ export class FunctionAppService {
431
430
}
432
431
433
432
deleteFunction ( context : FunctionAppContext , functionInfo : FunctionInfo ) : Result < void > {
434
- return this . getClient ( context ) . execute ( { resourceId : context . site . id } , t =>
435
- this . _cacheService . delete ( functionInfo . href , this . jsonHeaders ( t ) ) ) ;
436
- // .concatMap(r => this.getRuntimeGeneration())
437
- // .concatMap((runtimeVersion: string) => {
438
- // return runtimeVersion === 'V2'
439
- // ? this.updateDisabledAppSettings([functionInfo])
440
- // : Observable.of(null);
441
- // }));
433
+ return this . getClient ( context )
434
+ . execute ( { resourceId : context . site . id } , t => {
435
+ return this . _cacheService . delete ( functionInfo . href , this . jsonHeaders ( t ) ) ;
436
+ } )
437
+ . do ( r => {
438
+ this . _cacheService . clearCachePrefix ( context . urlTemplates . functionsUrl ) ;
439
+ } ) ;
442
440
}
443
441
444
442
// TODO: [ahmels] change to Result<T>
0 commit comments