From 272244cb39ab824335b1d34aed6d929f6a06b6c2 Mon Sep 17 00:00:00 2001 From: Chantsova Ekaterina Date: Thu, 29 Aug 2024 18:50:37 +0300 Subject: [PATCH] UI: Image service - add default value for image sub-type --- ui-ngx/src/app/core/http/image.service.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ui-ngx/src/app/core/http/image.service.ts b/ui-ngx/src/app/core/http/image.service.ts index eb15b658e5..68c128028f 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,7 +87,7 @@ export class ImageService { imageInfo, defaultHttpOptionsFromConfig(config)); } - public getImages(pageLink: PageLink, imageSubType: ResourceSubType, + public getImages(pageLink: PageLink, imageSubType: ResourceSubType = ResourceSubType.IMAGE, includeSystemImages = false, config?: RequestConfig): Observable> { return this.http.get>( `${IMAGES_URL_PREFIX}${pageLink.toQuery()}&imageSubType=${imageSubType}&includeSystemImages=${includeSystemImages}`,