diff --git a/ui-ngx/src/app/core/http/image.service.ts b/ui-ngx/src/app/core/http/image.service.ts index eb15b658e5..835e8ffb61 100644 --- a/ui-ngx/src/app/core/http/image.service.ts +++ b/ui-ngx/src/app/core/http/image.service.ts @@ -21,11 +21,15 @@ import { defaultHttpOptionsFromConfig, defaultHttpUploadOptions, RequestConfig } import { Observable, of, ReplaySubject } from 'rxjs'; import { PageData } from '@shared/models/page/page-data'; import { - NO_IMAGE_DATA_URI, + ImageExportData, ImageResourceInfo, - imageResourceType, ImageResourceType, - IMAGES_URL_PREFIX, isImageResourceUrl, ImageExportData, removeTbImagePrefix, ResourceSubType + imageResourceType, + IMAGES_URL_PREFIX, + isImageResourceUrl, + NO_IMAGE_DATA_URI, + removeTbImagePrefix, + ResourceSubType } from '@shared/models/resource.models'; import { catchError, map, switchMap } from 'rxjs/operators'; import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; @@ -46,7 +50,8 @@ export class ImageService { ) { } - public uploadImage(file: File, title: string, imageSubType: ResourceSubType, config?: RequestConfig): Observable { + public uploadImage(file: File, title: string, imageSubType: ResourceSubType = ResourceSubType.IMAGE, + config?: RequestConfig): Observable { if (!config) { config = {}; } @@ -82,8 +87,8 @@ export class ImageService { imageInfo, defaultHttpOptionsFromConfig(config)); } - public getImages(pageLink: PageLink, imageSubType: ResourceSubType, - includeSystemImages = false, config?: RequestConfig): Observable> { + public getImages(pageLink: PageLink, includeSystemImages = false, + imageSubType: ResourceSubType = ResourceSubType.IMAGE, config?: RequestConfig): Observable> { return this.http.get>( `${IMAGES_URL_PREFIX}${pageLink.toQuery()}&imageSubType=${imageSubType}&includeSystemImages=${includeSystemImages}`, defaultHttpOptionsFromConfig(config)); diff --git a/ui-ngx/src/app/shared/components/image/image-gallery.component.ts b/ui-ngx/src/app/shared/components/image/image-gallery.component.ts index 5b50282ea7..23f489d78c 100644 --- a/ui-ngx/src/app/shared/components/image/image-gallery.component.ts +++ b/ui-ngx/src/app/shared/components/image/image-gallery.component.ts @@ -205,7 +205,7 @@ export class ImageGalleryComponent extends PageComponent implements OnInit, OnDe property: 'createdTime', direction: Direction.DESC }); - return this.imageService.getImages(pageLink, this.imageSubType, filter.includeSystemImages); + return this.imageService.getImages(pageLink, filter.includeSystemImages, this.imageSubType); }; } diff --git a/ui-ngx/src/app/shared/components/image/images-datasource.ts b/ui-ngx/src/app/shared/components/image/images-datasource.ts index 3a46508d45..78f02df4b1 100644 --- a/ui-ngx/src/app/shared/components/image/images-datasource.ts +++ b/ui-ngx/src/app/shared/components/image/images-datasource.ts @@ -84,7 +84,7 @@ export class ImagesDatasource implements DataSource { } fetchEntities(pageLink: PageLink, imageSubType: ResourceSubType, includeSystemImages = false): Observable> { - return this.imageService.getImages(pageLink, imageSubType, includeSystemImages); + return this.imageService.getImages(pageLink, includeSystemImages, imageSubType); } isAllSelected(): Observable {