@@ -3,7 +3,7 @@ import { ActionType } from './apis';
33import { RegionType , ApiServiceType , CapiCredentials } from './../interface' ;
44import { Capi } from '@tencent-sdk/capi' ;
55import { ApiTypeError } from '../../utils/error' ;
6- import { deepClone , formatInputTags , strip } from '../../utils' ;
6+ import { deepClone , strip } from '../../utils' ;
77import TagsUtils from '../tag/index' ;
88import ApigwUtils from '../apigw' ;
99import CONFIGS from './config' ;
@@ -260,7 +260,7 @@ export default class Scf {
260260 namespace : funcInfo . Namespace ,
261261 functionName : funcInfo . FunctionName ,
262262 ...trigger ,
263- tags : formatInputTags ( tags ) ,
263+ tags : this . tagClient . formatInputTags ( tags ) ,
264264 } ,
265265 } ) ;
266266
@@ -371,9 +371,10 @@ export default class Scf {
371371 }
372372
373373 // create/update tags
374- if ( inputs . tags ) {
374+ const tags = this . tagClient . formatInputTags ( inputs ?. tags as any ) ;
375+ if ( tags ) {
375376 const deployedTags = await this . tagClient . deployResourceTags ( {
376- tags : Object . entries ( inputs . tags ) . map ( ( [ TagKey , TagValue ] ) => ( { TagKey, TagValue } ) ) ,
377+ tags : tags . map ( ( { key , value } ) => ( { TagKey : key , TagValue : value } ) ) ,
377378 resourceId : `${ funcInfo ! . Namespace } /function/${ funcInfo ! . FunctionName } ` ,
378379 serviceType : ApiServiceType . scf ,
379380 resourcePrefix : 'namespace' ,
@@ -461,7 +462,7 @@ export default class Scf {
461462 }
462463
463464 checkAddedYunTiTags ( tags : Array < { [ key : string ] : string } > ) : boolean {
464- const formatTags = formatInputTags ( tags ) ;
465+ const formatTags = this . tagClient . formatInputTags ( tags ) ;
465466 const result =
466467 formatTags ?. length > 0 &&
467468 [ '运营部门' , '运营产品' , '负责人' ] . every ( ( tagKey ) =>
0 commit comments