Socket
Socket
Sign inDemoInstall

vanilli-shop-client

Package Overview
Dependencies
Maintainers
1
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilli-shop-client - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

dist/api/discount-api.d.ts

1

dist/models/order.d.ts

@@ -7,2 +7,3 @@ import { ICustomerDto } from "./customer";

couponCode?: string;
discount?: number;
customer: ICustomerDto;

@@ -9,0 +10,0 @@ shipping: IOrderShippingDto;

3

dist/stores/cart-store.js

@@ -79,3 +79,4 @@ "use strict";

var _a;
var discountPercentage = (_a = this.rootStore.couponStore.appliedCoupon) === null || _a === void 0 ? void 0 : _a.percentage;
var rootStore = this.rootStore;
var discountPercentage = ((_a = rootStore.couponStore.appliedCoupon) === null || _a === void 0 ? void 0 : _a.percentage) || rootStore.discountStore.appliedDiscount;
if (!discountPercentage) {

@@ -82,0 +83,0 @@ return undefined;

@@ -124,2 +124,3 @@ "use strict";

order.couponCode = (_b = rootStore.couponStore.appliedCoupon) === null || _b === void 0 ? void 0 : _b.code;
order.discount = rootStore.discountStore.appliedDiscount;
order.shipping.countryId = (_c = rootStore.countryStore.selectedCountry) === null || _c === void 0 ? void 0 : _c.id;

@@ -126,0 +127,0 @@ order.shipping.methodId = (_d = shippingStore.selectedMethod) === null || _d === void 0 ? void 0 : _d.methodId;

@@ -23,2 +23,4 @@ import NotificationStore from "./notification-store";

import CategoryApi from "../api/category-api";
import DiscountApi from "../api/discount-api";
import DiscountStore from "./discount-store";
interface IRootStore {

@@ -31,2 +33,3 @@ blogStore: BlogStore;

couponStore: CouponStore;
discountStore: DiscountStore;
emailStore: EmailStore;

@@ -47,2 +50,3 @@ notificationStore: NotificationStore;

couponStore: CouponStore;
discountStore: DiscountStore;
emailStore: EmailStore;

@@ -60,2 +64,3 @@ notificationStore: NotificationStore;

couponApi: CouponApi;
discountApi: DiscountApi;
emailApi: EmailApi;

@@ -62,0 +67,0 @@ orderApi: OrderApi;

@@ -48,2 +48,4 @@ "use strict";

var category_api_1 = __importDefault(require("../api/category-api"));
var discount_api_1 = __importDefault(require("../api/discount-api"));
var discount_store_1 = __importDefault(require("./discount-store"));
var RootStore = /** @class */ (function () {

@@ -62,2 +64,3 @@ function RootStore() {

this.couponStore = new coupon_store_1.default(this);
this.discountStore = new discount_store_1.default(this);
this.emailStore = new email_store_1.default(this);

@@ -73,2 +76,3 @@ this.orderStore = new order_store_1.default(this);

this.couponApi = new coupon_api_1.default();
this.discountApi = new discount_api_1.default();
this.emailApi = new email_api_1.default();

@@ -75,0 +79,0 @@ this.orderApi = new order_api_1.default();

{
"name": "vanilli-shop-client",
"version": "1.4.1",
"version": "1.4.2",
"description": "Client for Vanilli Shop API",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -8,2 +8,3 @@ import {ICustomerDto} from "./customer";

couponCode?: string,
discount?: number,
customer: ICustomerDto,

@@ -10,0 +11,0 @@ shipping: IOrderShippingDto,

@@ -70,3 +70,4 @@ import BaseStore from "./base-store";

calculateDiscount(): number | undefined {
const discountPercentage = this.rootStore.couponStore.appliedCoupon?.percentage;
const rootStore = this.rootStore;
const discountPercentage = rootStore.couponStore.appliedCoupon?.percentage || rootStore.discountStore.appliedDiscount;

@@ -73,0 +74,0 @@ if (!discountPercentage) {

@@ -57,2 +57,3 @@ import BaseStore from "./base-store";

order.couponCode = rootStore.couponStore.appliedCoupon?.code;
order.discount = rootStore.discountStore.appliedDiscount;
order.shipping.countryId = rootStore.countryStore.selectedCountry?.id;

@@ -59,0 +60,0 @@ order.shipping.methodId = shippingStore.selectedMethod?.methodId;

@@ -24,2 +24,4 @@ import * as mobx from "mobx";

import CategoryApi from "../api/category-api";
import DiscountApi from "../api/discount-api";
import DiscountStore from "./discount-store";

@@ -33,2 +35,3 @@ interface IRootStore {

couponStore: CouponStore,
discountStore: DiscountStore,
emailStore: EmailStore,

@@ -50,2 +53,3 @@ notificationStore: NotificationStore,

couponStore: CouponStore;
discountStore: DiscountStore;
emailStore: EmailStore;

@@ -63,2 +67,3 @@ notificationStore: NotificationStore;

couponApi: CouponApi;
discountApi: DiscountApi;
emailApi: EmailApi;

@@ -82,2 +87,3 @@ orderApi: OrderApi;

this.couponStore = new CouponStore(this);
this.discountStore = new DiscountStore(this);
this.emailStore = new EmailStore(this);

@@ -93,2 +99,3 @@ this.orderStore = new OrderStore(this);

this.couponApi = new CouponApi();
this.discountApi = new DiscountApi();
this.emailApi = new EmailApi();

@@ -95,0 +102,0 @@ this.orderApi = new OrderApi();

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc