File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed
WebAPI/LearningHub.Nhs.API Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ namespace LearningHub.Nhs.WebUI.Controllers.Api
22{
33 using System ;
44 using System . Collections . Generic ;
5+ using System . Linq ;
56 using System . Threading . Tasks ;
67 using LearningHub . Nhs . Models . Enums ;
78 using LearningHub . Nhs . Models . Resource ;
@@ -565,9 +566,9 @@ public async Task<ActionResult> DeleteResourceProviderAsync(int resourceVersionI
565566 /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
566567 [ HttpPost ]
567568 [ Route ( "ArchiveResourceFile" ) ]
568- public ActionResult ArchiveResourceFile ( List < string > filePaths )
569+ public ActionResult ArchiveResourceFile ( IEnumerable < string > filePaths )
569570 {
570- _ = Task . Run ( async ( ) => { await this . fileService . PurgeResourceFile ( null , filePaths ) ; } ) ;
571+ _ = Task . Run ( async ( ) => { await this . fileService . PurgeResourceFile ( null , filePaths . ToList ( ) ) ; } ) ;
571572 return this . Ok ( ) ;
572573 }
573574
Original file line number Diff line number Diff line change 822822 this .fileUploadRef .value = null ;
823823 (this .$refs .fileUploader as any ).uploadResourceFile (this .file );
824824 },
825- fileUploadComplete(uploadResult : FileUploadResult ) {
825+ async fileUploadComplete(uploadResult : FileUploadResult ) {
826826 if (! uploadResult .invalid ) {
827827 if (uploadResult .resourceType != ResourceType .SCORM ) {
828828 this .$store .commit (" setResourceType" , uploadResult .resourceType );
841841 }
842842
843843 if (this .filePathBeforeFileChange .length > 0 ) {
844- this .getResourceFilePath (' completed' );
844+ await this .getResourceFilePath (' completed' );
845845 if (this .filePathBeforeFileChange .length > 0 && this .filePathAfterFileChange .length > 0 ) {
846846 let filePaths = this .filePathBeforeFileChange .filter (item => ! this .filePathAfterFileChange .includes (item ));
847847 if (filePaths .length > 0 ) {
10401040 await resourceData .getObsoleteResourceFile (resource .resourceVersionId ).then (response => {
10411041 if (fileChangeStatus == ' initialised' ) {
10421042 this .filePathBeforeFileChange = response ;
1043+ this .filePathAfterFileChange .length = 0 ;
10431044 }
10441045 else if (fileChangeStatus == ' completed' ) {
10451046 this .filePathAfterFileChange = response ;
Original file line number Diff line number Diff line change @@ -558,8 +558,8 @@ const getObsoleteResourceFile = async function (id: number): Promise<string[]> {
558558} ;
559559
560560const archiveResourceFile = async function ( filepaths : string [ ] ) : Promise < boolean > {
561- const params = { filePaths : filepaths } ;
562- return await AxiosWrapper . axios . post ( '/api/Resource/DuplicateBlocks ' , params ) . then ( ( ) => {
561+
562+ return await AxiosWrapper . axios . post ( '/api/Resource/ArchiveResourceFile ' , filepaths ) . then ( ( ) => {
563563 return true
564564 } ) . catch ( e => {
565565 console . log ( 'archiveResourceFile:' + e ) ;
Original file line number Diff line number Diff line change 44 <DebuggerFlavor >ProjectDebugger</DebuggerFlavor >
55 </PropertyGroup >
66 <PropertyGroup >
7- <ActiveDebugProfile >IIS Local </ActiveDebugProfile >
7+ <ActiveDebugProfile >API IIS </ActiveDebugProfile >
88 </PropertyGroup >
99 <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Debug|x64'" >
1010 <DebuggerFlavor >ProjectDebugger</DebuggerFlavor >
You can’t perform that action at this time.
0 commit comments