File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ export class UpdateFunctionDto {
40
40
@IsNotEmpty ( { each : true } )
41
41
tags : string [ ]
42
42
43
+ @ApiPropertyOptional ( )
44
+ @MaxLength ( 256 )
45
+ changelog ?: string
46
+
43
47
validate ( ) {
44
48
return null
45
49
}
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ export class CloudFunctionHistory {
19
19
@ApiProperty ( { type : CloudFunctionHistorySource } )
20
20
source : CloudFunctionHistorySource
21
21
22
+ @ApiProperty ( { type : String } )
23
+ changelog ?: string
24
+
22
25
@ApiProperty ( )
23
26
createdAt : Date
24
27
}
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export class FunctionService {
59
59
60
60
const fn = await this . findOne ( appid , dto . name )
61
61
62
- await this . addOneHistoryRecord ( fn )
62
+ await this . addOneHistoryRecord ( fn , 'created' )
63
63
await this . publish ( fn )
64
64
return fn
65
65
}
@@ -175,7 +175,7 @@ export class FunctionService {
175
175
)
176
176
177
177
const fn = await this . findOne ( func . appid , func . name )
178
- await this . addOneHistoryRecord ( fn )
178
+ await this . addOneHistoryRecord ( fn , dto . changelog )
179
179
await this . publish ( fn )
180
180
181
181
return fn
@@ -414,7 +414,7 @@ export class FunctionService {
414
414
return history
415
415
}
416
416
417
- async addOneHistoryRecord ( func : CloudFunction ) {
417
+ async addOneHistoryRecord ( func : CloudFunction , changelog = '' ) {
418
418
await this . db
419
419
. collection < CloudFunctionHistory > ( 'CloudFunctionHistory' )
420
420
. insertOne ( {
@@ -424,6 +424,7 @@ export class FunctionService {
424
424
code : func . source . code ,
425
425
} ,
426
426
createdAt : new Date ( ) ,
427
+ changelog,
427
428
} )
428
429
}
429
430
You can’t perform that action at this time.
0 commit comments