fix: job reporting

This commit is contained in:
Jannat Patel
2022-01-11 15:10:31 +05:30
parent 8fff1cd817
commit e214573cd1
11 changed files with 147 additions and 59 deletions

27
school/www/jobs/job.js Normal file
View File

@@ -0,0 +1,27 @@
frappe.ready(() => {
$("#report").click((e) => {
open_report_dialog(e);
});
$("#submit-report").click((e) => {
report(e);
});
});
const open_report_dialog = (e) => {
e.preventDefault();
$("#report-modal").modal("show");
};
const report = (e) => {
frappe.call({
method: "school.job.doctype.job_opportunity.job_opportunity.report",
args: {
"job": $(e.currentTarget).data("job"),
"reason": $(".report-field").val()
},
callback: (data) => {
frappe.msgprint(__("Thanks for informing us about this post. Site admins will look into this and take an appropriate action soon."))
}
})
}