@wizishop/img-manager 15.2.1 → 15.2.3

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.
@@ -1083,17 +1083,20 @@ class ImgUploadComponent {
1083
1083
  formData.append('image', file, file.name);
1084
1084
  imgToUploadList.push(this.uploadService.uploadFile(formData));
1085
1085
  }
1086
- forkJoin(imgToUploadList).subscribe((img) => {
1087
- this.onImgUpload(img),
1086
+ forkJoin(imgToUploadList).subscribe({
1087
+ next: (img) => {
1088
+ this.onImgUpload(img),
1089
+ this.isLoading = false;
1090
+ },
1091
+ error: error => {
1092
+ if (error?.error?.message && error.statusText !== 'Bad Request') {
1093
+ this.alertService.openAlertWithBackendResponse(this.errorUploadingImg, error.error.message);
1094
+ }
1095
+ else {
1096
+ this.alertService.openAlert(this.errorUploadingImg);
1097
+ }
1088
1098
  this.isLoading = false;
1089
- }, error => {
1090
- if (error?.error?.message && error.statusText !== 'Bad Request') {
1091
- this.alertService.openAlertWithBackendResponse(this.errorUploadingImg, error.error.message);
1092
- }
1093
- else {
1094
- this.alertService.openAlert(this.errorUploadingImg);
1095
1099
  }
1096
- this.isLoading = false;
1097
1100
  });
1098
1101
  }
1099
1102
  /**
@@ -1172,7 +1175,7 @@ class PexelsService {
1172
1175
  request = `/search?query=${toSearch}&per_page=${perPage}&page=${page}&locale=${this.lang}`;
1173
1176
  }
1174
1177
  else { // Search by category or display Pexels selection
1175
- const shopCategory = this.apiService.CONFIG.shop_category;
1178
+ const shopCategory = this.apiService.getShopCategory();
1176
1179
  // Search by shop category
1177
1180
  if (shopCategory && shopCategory !== 'other' && shopCategory !== 'btob') {
1178
1181
  request = `/search?query=${shopCategory}&per_page=${perPage}&page=${page}&locale=en-US`;
@@ -3397,11 +3400,11 @@ class ImagesViewComponent {
3397
3400
  }
3398
3401
  this.isTotalRetrieved = false;
3399
3402
  this.imgManager.getShopTotalImgList(this.params).pipe(take(1)).subscribe({
3400
- next: (data) => {
3403
+ next: total => {
3401
3404
  this.previousSearchValue = searchValue;
3402
3405
  this.isTotalRetrieved = true;
3403
- this.length = data.totalRecords;
3404
- this.tableFilters.totalItems = data.totalRecords;
3406
+ this.length = total;
3407
+ this.tableFilters.totalItems = total;
3405
3408
  },
3406
3409
  error: error => {
3407
3410
  //this.alertService.openAlert(this.errorGetTotalImg);