diff --git a/frontend/src/app/component/images/images.component.html b/frontend/src/app/component/images/images.component.html index e4f9976..2b9a7d1 100644 --- a/frontend/src/app/component/images/images.component.html +++ b/frontend/src/app/component/images/images.component.html @@ -18,6 +18,12 @@ ✓ | X (TO BE DONE) + + + @@ -36,16 +42,11 @@ [meta]=image (reload)="loadImage(i + paginationGetStart(), $event.split('.')[0])" > - - - - - { - this.images = this.images.filter(im => im !== image); this.snackbar.open('Successfully deleted ' + image.filename, 'Dismiss'); this.reload.emit(); }).catch(err => this.logger.error(err)); diff --git a/frontend/src/app/component/landing/landing.component.html b/frontend/src/app/component/landing/landing.component.html index a1f46d5..902ec53 100644 --- a/frontend/src/app/component/landing/landing.component.html +++ b/frontend/src/app/component/landing/landing.component.html @@ -6,7 +6,7 @@ - + @@ -14,4 +14,3 @@ -No images found diff --git a/frontend/src/app/services/rest.service.ts b/frontend/src/app/services/rest.service.ts index 818c5e1..6576f7b 100644 --- a/frontend/src/app/services/rest.service.ts +++ b/frontend/src/app/services/rest.service.ts @@ -23,14 +23,6 @@ export class RestService { private updateImageUrl = this.imageUrl + '/update'; private healthCheckUrl = this.currentLocation + '/check'; - private static stripUploadFileName(name: string) { - // const generalUploadFileName: string = - // (document.getElementById('generalUpload').firstChild as HTMLElement).children[5].children[0].textContent; - // this.logger.debug('Get filename', generalUploadFileName); - const temp: string[] = name.split('.'); - return temp.slice(0, temp.length - 1).join('.'); - } - public getAllImages(): Observable { return this.http.get(this.getImageUrl + '/all').pipe( tap(next => this.logger.debug('getAllImages', next)) @@ -55,10 +47,9 @@ export class RestService { ); } - public deleteImage(filenameWithExtension: string): Observable { - const stripped = RestService.stripUploadFileName(filenameWithExtension); - return this.http.delete(this.deleteImageUrl + '/' + stripped).pipe( - tap(next => this.logger.debug('deleteImage', stripped, next)) + public deleteImage(filename: string): Observable { + return this.http.delete(this.deleteImageUrl + '/' + filename).pipe( + tap(next => this.logger.debug('deleteImage', filename, next)) ); }