sk-front-lib 0.19.5 → 0.19.7

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.
@@ -4,7 +4,7 @@ import { map, tap, catchError, switchMap, take } from 'rxjs/operators';
4
4
  import * as i1 from 'sk-front-lib/api';
5
5
  import { ApiPageableParam } from 'sk-front-lib/api';
6
6
  import { SkFile, SkUser, SkDocument, SkBoard, SkProduct, SkPromotion, SkCart, SkOrderDetail, SkPoint, SkDocumentCommentParent, SkStore } from 'sk-front-lib/model';
7
- import { BehaviorSubject, of } from 'rxjs';
7
+ import { BehaviorSubject, of, throwError } from 'rxjs';
8
8
  import * as i2 from '@angular/router';
9
9
  import { HttpParams } from '@angular/common/http';
10
10
  import { SkUtils } from 'sk-front-lib';
@@ -909,6 +909,10 @@ class SkCartLocalService {
909
909
  const cartList = this.loadRaw();
910
910
  const index = this.loadRaw().findIndex(item => item.id === cart.id);
911
911
  if (index > -1) {
912
+ if (cart.product.maxBuyCount > 0 && cart.amount > cart.product.maxBuyCount) {
913
+ // 에러 리턴
914
+ return throwError('최대 구매 수량을 초과하였습니다.');
915
+ }
912
916
  cartList[index] = cart;
913
917
  localStorage.setItem('cartData', SkUtils.encodeBase64(cartList));
914
918
  }