@@ -149,6 +149,7 @@ export class ResourcesService {
149149 'name' ,
150150 'attrs' ,
151151 'parentId' ,
152+ 'createdAt' ,
152153 'updatedAt' ,
153154 'namespaceId' ,
154155 'resourceType' ,
@@ -331,6 +332,7 @@ export class ResourcesService {
331332 'name' ,
332333 'attrs' ,
333334 'parentId' ,
335+ 'createdAt' ,
334336 'updatedAt' ,
335337 'namespaceId' ,
336338 'resourceType' ,
@@ -459,7 +461,16 @@ export class ResourcesService {
459461 }
460462
461463 const children = await this . resourceRepository . find ( {
462- select : [ 'id' , 'name' , 'parentId' , 'resourceType' , 'attrs' , 'tagIds' ] ,
464+ select : [
465+ 'id' ,
466+ 'name' ,
467+ 'parentId' ,
468+ 'resourceType' ,
469+ 'attrs' ,
470+ 'tagIds' ,
471+ 'createdAt' ,
472+ 'updatedAt' ,
473+ ] ,
463474 where : {
464475 namespaceId,
465476 parentId : resourceId ,
@@ -574,7 +585,15 @@ export class ResourcesService {
574585 while ( true ) {
575586 const resource = await this . resourceRepository . findOne ( {
576587 where : { namespaceId, id : resourceId } ,
577- select : [ 'id' , 'name' , 'resourceType' , 'parentId' , 'globalPermission' ] ,
588+ select : [
589+ 'id' ,
590+ 'name' ,
591+ 'resourceType' ,
592+ 'parentId' ,
593+ 'globalPermission' ,
594+ 'createdAt' ,
595+ 'updatedAt' ,
596+ ] ,
578597 } ) ;
579598 if ( ! resource ) {
580599 throw new NotFoundException ( 'Resource not found' ) ;
@@ -698,7 +717,8 @@ export class ResourcesService {
698717 parentId ?: string ,
699718 resourceId ?: string ,
700719 ) {
701- const originalName = encodeFileName ( fileName ) ;
720+ const originalName = getOriginalFileName ( fileName ) ;
721+ const encodedName = encodeFileName ( fileName ) ;
702722 let resource : Resource ;
703723 if ( resourceId ) {
704724 resource = await this . get ( resourceId ) ;
@@ -713,6 +733,7 @@ export class ResourcesService {
713733 parentId,
714734 attrs : {
715735 original_name : originalName ,
736+ encoded_name : encodedName ,
716737 mimetype : mimetype ,
717738 } ,
718739 } ) ;
0 commit comments