@veloceapps/api 7.0.2-42 → 7.0.2-43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/services/catalog-admin-api.service.mjs +28 -1
- package/fesm2015/veloceapps-api.mjs +27 -1
- package/fesm2015/veloceapps-api.mjs.map +1 -1
- package/fesm2020/veloceapps-api.mjs +27 -1
- package/fesm2020/veloceapps-api.mjs.map +1 -1
- package/lib/services/catalog-admin-api.service.d.ts +5 -1
- package/package.json +1 -1
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
|
|
4
4
|
import { Injectable, NgModule } from '@angular/core';
|
5
5
|
import * as i1 from '@veloceapps/core';
|
6
6
|
import { uiDefinitionFromDTO, isLegacyUIDefinition, ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, BaseHttpService, XrayService } from '@veloceapps/core';
|
7
|
-
import { throwError, of, zip, forkJoin, map as map$1,
|
7
|
+
import { noop, throwError, of, zip, forkJoin, map as map$1, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
|
8
8
|
import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
|
9
9
|
import * as i2 from 'primeng/api';
|
10
10
|
import { CurrencyPipe } from '@angular/common';
|
@@ -240,6 +240,32 @@ class CatalogAdminApiService {
|
|
240
240
|
});
|
241
241
|
};
|
242
242
|
}
|
243
|
+
attachImage$(catalogId, categoryId, file) {
|
244
|
+
const data = new FormData();
|
245
|
+
data.append('image', file);
|
246
|
+
return this.baseHttpService.upload({
|
247
|
+
method: 'post',
|
248
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
|
249
|
+
body: data,
|
250
|
+
});
|
251
|
+
}
|
252
|
+
removeImage$(catalogId, categoryId) {
|
253
|
+
return this.baseHttpService.api({
|
254
|
+
method: 'delete',
|
255
|
+
url: `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`,
|
256
|
+
});
|
257
|
+
}
|
258
|
+
fetchImage$(catalogId, categoryId) {
|
259
|
+
return this.baseHttpService.api({
|
260
|
+
url: this.getImageUrl(catalogId, categoryId),
|
261
|
+
method: 'get',
|
262
|
+
responseType: 'blob',
|
263
|
+
errorHandler: noop,
|
264
|
+
});
|
265
|
+
}
|
266
|
+
getImageUrl(catalogId, categoryId) {
|
267
|
+
return `${this.serviceUrl}/${catalogId}/categories/${categoryId}/image`;
|
268
|
+
}
|
243
269
|
}
|
244
270
|
CatalogAdminApiService.MAX_RESULTS = 60;
|
245
271
|
CatalogAdminApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: CatalogAdminApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
|