Skip to content

Commit

Permalink
Merge pull request #180 from Salesforce-org-Impact-Labs/lwc_Service_Reqs
Browse files Browse the repository at this point in the history
Lwc service reqs
  • Loading branch information
AIrwin33 authored Aug 13, 2020
2 parents 070fe8d + b351f9d commit 2e2d5ad
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,4 +185,4 @@
</div>
</footer>
</article>
</template>
</template>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-empty */
import { LightningElement, api } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';

import hideContacts from '@salesforce/apex/serviceHide.hide';
import unhideContacts from '@salesforce/apex/serviceHide.unHide';
Expand Down Expand Up @@ -76,7 +77,7 @@ export default class ServiceRecommendation extends NavigationMixin(LightningElem
.then(() => {
window.console.log('success');
let eventParams = 'reloadAfterHide';
const flowLaunchEvent = new CustomEvent('reloadafterhide', {
let flowLaunchEvent = new CustomEvent('reloadafterhide', {
detail: {
eventParams
},
Expand All @@ -96,7 +97,7 @@ export default class ServiceRecommendation extends NavigationMixin(LightningElem
.then(() => {
window.console.log('success');
let eventParams = 'reloadAfterHide';
const flowLaunchEvent = new CustomEvent('reloadafterhide', {
let flowLaunchEvent = new CustomEvent('reloadafterhide', {
detail: {
eventParams
},
Expand All @@ -115,7 +116,7 @@ export default class ServiceRecommendation extends NavigationMixin(LightningElem
.then(() => {
window.console.log('success');
let eventParams = 'reloadAfterHide';
const flowLaunchEvent = new CustomEvent('reloadafterhide', {
let flowLaunchEvent = new CustomEvent('reloadafterhide', {
detail: {
eventParams
},
Expand All @@ -134,7 +135,7 @@ export default class ServiceRecommendation extends NavigationMixin(LightningElem
.then(() => {
window.console.log('success');
let eventParams = 'reloadAfterHide';
const flowLaunchEvent = new CustomEvent('reloadafterhide', {
let flowLaunchEvent = new CustomEvent('reloadafterhide', {
detail: {
eventParams
},
Expand Down Expand Up @@ -181,13 +182,35 @@ export default class ServiceRecommendation extends NavigationMixin(LightningElem
newComment: this.newComment
})
.then(() => {
window.console.log('success');
this.showAddComment = false;
this.commentCount = this.commentCount + 1;
this.handleReloadPage();
let evt = new ShowToastEvent({
title: 'Comment Added',
message: '',
variant: 'success',
});
this.dispatchEvent(evt);
window.console.log('after event?')
})
.catch((error) => {
window.console.log('error:' + error);
});
}

handleReloadPage() {
let eventParams = 'reloadAfterHide';
let flowLaunchEvent = new CustomEvent('reloadafterhide', {
detail: {
eventParams
},
});
// Fire the custom event

this.dispatchEvent(flowLaunchEvent);
window.console.log('here');
}

handlePrintReferral() {

print({ serviceId: this.serviceid })
Expand Down

0 comments on commit 2e2d5ad

Please sign in to comment.