From 80e4f70de2ef15df8b22ccdeef1ef7fb423b1302 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 2 Oct 2024 08:30:18 -0400 Subject: [PATCH] offer refresh --- .../offers-received.component.ts | 23 +++++++++++++++---- src/app/store/banners-data.service.ts | 2 +- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/app/components/offers-received/offers-received.component.ts b/src/app/components/offers-received/offers-received.component.ts index 0ac9d70..a8fd2c0 100644 --- a/src/app/components/offers-received/offers-received.component.ts +++ b/src/app/components/offers-received/offers-received.component.ts @@ -57,7 +57,7 @@ export class OffersReceivedComponent implements OnInit { currOpenOffer:string=''; openOfferDetail(item){ if ( this.currOpenOffer != '' && this.currOpenOffer == item.offer_uid){ - this.currOpenOffer = '' + this.currOpenOffer = ''; }else { this.currOpenOffer = item.offer_uid; @@ -141,6 +141,7 @@ export class OffersReceivedComponent implements OnInit { message: 'Processing', duration: 3000, }); + this.currOpenOffer = ''; // c;ose the offer window this.responseData = { action:15010, member_id: this.sessionDataProviderService.member_id, @@ -157,13 +158,25 @@ export class OffersReceivedComponent implements OnInit { console.log("offerRespData RETURN->", this.offerRespData); const refresh_banner = new CustomEvent("app-banner-refresh-nocache"); dispatchEvent(refresh_banner); - - if( respType == 100 ){ // only in acceptance approval +//debugger; + if( respType == 100 && this.offerRespData?.contract != undefined && this.offerRespData?.contract !='' ){ // only in acceptance approval + this.findRemoveItemInArray(this.responseData.contract) this.router.navigate(['activetask'],{state: this.offerRespData}); } - - this.reduceOfferData(); + else{ + this.reduceOfferData(); + } } ); } + + findRemoveItemInArray(offer_code:any){ + // console.log("AMEYE OFFER CODE ->", offer_code); + //console.log("AMEYE BEFORE ->", this.offerData); + this.offerData = this.offerData.filter((item)=> item.contract !== offer_code ) + //console.log("AMEYE AFTER ->", this.offerData); + //debugger; + this.reduceOfferData(); + + } } diff --git a/src/app/store/banners-data.service.ts b/src/app/store/banners-data.service.ts index c8acdfc..d544d64 100644 --- a/src/app/store/banners-data.service.ts +++ b/src/app/store/banners-data.service.ts @@ -20,7 +20,7 @@ export class BannersDataService { addEventListener(" app-banner-refresh-nocache", () => { - this.getBannersData(); + this.getBannersData(true); });