Skip to content

Commit

Permalink
Update opps-coupon-codes.service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
anjana-bl committed Apr 28, 2024
1 parent 33ba836 commit 19bfa13
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class OppsCouponCodesService {
protected localStorageKey =
this.config.opps?.couponcodes?.localStorageKey ?? '';

saveUrlCouponCodes() {
saveUrlCouponCodes(): void {
const urlParam = this.config.opps?.couponcodes?.urlParameter ?? '';
const url = this.winRef.location.href ?? '';
const queryParams = new URLSearchParams(url.substring(url.indexOf('?')));
Expand All @@ -24,7 +24,7 @@ export class OppsCouponCodesService {
this.setCouponCodes(oppsCoupon);
}
}
setCouponCodes(couponCodes: string) {
setCouponCodes(couponCodes: string): void {
if (this.localStorageKey && couponCodes) {
this.winRef.localStorage?.setItem(this.localStorageKey, couponCodes);
}
Expand All @@ -34,9 +34,9 @@ export class OppsCouponCodesService {
return this.winRef.localStorage?.getItem(this.localStorageKey);
}
}
clearCouponCodes() {
clearCouponCodes(): void {
if (this.localStorageKey) {
return this.winRef.localStorage?.removeItem(this.localStorageKey);
this.winRef.localStorage?.removeItem(this.localStorageKey);
}
}
}

0 comments on commit 19bfa13

Please sign in to comment.