Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. getDataParam(url: any, params: any) {
  2. return this.http
  3. .get(url, { params: params })
  4. .pipe(catchError(this.handleError))
  5. .subscribe(response => response);
  6. }
  7.  
  8. createData(url: any, data: any) {
  9. return this.http
  10. .post(url, data)
  11. .pipe(catchError(this.handleError))
  12. .subscribe(response => response);
  13. }
  14.  
  15. export class LegalorderService extends BaseService {
  16. private token: string;
  17.  
  18. constructor(http: HttpClient, auth: AuthService) {
  19. super(http);
  20. auth.isAuthenticated();
  21. this.token = auth.token;
  22. }
  23.  
  24. getCart() {
  25. let params = { access_token: this.token };
  26. return this.getDataParam(
  27. Configuration.BASE_URL + Configuration.GET_SAVED_CART,
  28. params
  29. );
  30. }
  31. }
  32.  
  33. updateValue() {
  34. this.legalOrderService.getCart().subscribe(response => {
  35. if (response.message != "ERROR") {
  36. this.localStorageService.store("legalOrder", response.result);
  37. this.localStorageService.store(
  38. "cartItems",
  39. response.result.order_details
  40. );
  41. this.cartTotal = this.localStorageService.retrieve("cartItems");
  42. }
  43. });
  44. }
  45.  
  46. ERROR in node_modules/rxjs/internal/Subscription.d.ts(16,3): error TS2374: Duplicate string index signature.
  47. node_modules/rxjs/internal/Subscription.d.ts(17,3): error TS2393: Duplicate function implementation.
  48. node_modules/rxjs/internal/Subscription.d.ts(17,44): error TS1183: An implementation cannot be declared in ambient contexts.
  49. node_modules/rxjs/internal/Subscription.d.ts(20,3): error TS2393: Duplicate function implementation.
  50. node_modules/rxjs/internal/Subscription.d.ts(20,44): error TS1183: An implementation cannot be declared in ambient contexts.
  51. node_modules/typescript/lib/lib.es5.d.ts(124,5): error TS2411: Property 'constructor' of type 'Function' is not assignable to string index type 'string'.
  52. node_modules/typescript/lib/lib.es5.d.ts(127,5): error TS2411: Property 'toString' of type '() => string' is not assignable to string index type 'string'.
  53. node_modules/typescript/lib/lib.es5.d.ts(130,5): error TS2411: Property 'toLocaleString' of type '() => string' is not assignable to string index type 'string'.
  54. node_modules/typescript/lib/lib.es5.d.ts(133,5): error TS2411: Property 'valueOf' of type '() => Object' is not assignable to string index type 'string'.
  55. node_modules/typescript/lib/lib.es5.d.ts(139,5): error TS2411: Property 'hasOwnProperty' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'string'.
  56. node_modules/typescript/lib/lib.es5.d.ts(145,5): error TS2411: Property 'isPrototypeOf' of type '(v: Object) => boolean' is not assignable to string index type 'string'.
  57. node_modules/typescript/lib/lib.es5.d.ts(151,5): error TS2411: Property 'propertyIsEnumerable' of type '(v: string | number | symbol) => boolean' is not assignable to string index type 'string'.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement