Skip to content

Commit

Permalink
Merge pull request #6442 from ever-co/fix/#6424-applied-job-disappear…
Browse files Browse the repository at this point in the history
…-row

Fix :: After applied jobs should disappear #6424
  • Loading branch information
rahul-rocket authored Jun 29, 2023
2 parents 6f01b7b + a8fdf13 commit 49b267e
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions apps/gauzy/src/app/pages/jobs/search/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,27 +377,25 @@ export class SearchComponent extends PaginationFilterBaseComponent implements On

try {
const appliedJob = await this.jobService.applyJob(applyJobPost);

this.toastrService.success('TOASTR.MESSAGE.JOB_APPLIED');
this.smartTableSource.refresh();

// removed selected row from table after applied
const row = document.querySelector('ng2-smart-table > table > tbody > .ng2-smart-row.selected');
if (!!row) {
row.remove();
this.onSelectJob({ isSelected: false, data: null });
}

if (appliedJob.isRedirectRequired) {
// If we have generated proposal, let's copy to clipboard
if (appliedJob.proposal) {
await this.copyTextToClipboard(appliedJob.proposal);
} else {
const proposalTemplate =
await this.getEmployeeDefaultProposalTemplate(
this.selectedJob
);

const proposalTemplate = await this.getEmployeeDefaultProposalTemplate(this.selectedJob);
if (proposalTemplate) {
await this.copyTextToClipboard(
proposalTemplate.content
);
await this.copyTextToClipboard(proposalTemplate.content);
}
}

window.open(this.selectedJob.jobPost.url, '_blank');
}
} catch (error) {
Expand All @@ -411,9 +409,7 @@ export class SearchComponent extends PaginationFilterBaseComponent implements On
return;
}
try {
const { providerCode, providerJobId, employeeId } =
this.selectedJob;

const { providerCode, providerJobId, employeeId } = this.selectedJob;
const applyJobPost: IEmployeeJobApplication = {
applied: true,
...(isNotEmpty(this.selectedEmployee)
Expand Down

0 comments on commit 49b267e

Please sign in to comment.