revert: async await in breadcrumbs.js

This commit is contained in:
Shariq Ansari 2022-11-10 17:32:25 +05:30
parent 19bb79215f
commit 31415bb72d

View file

@ -29,7 +29,7 @@ frappe.breadcrumbs = {
return localStorage["preferred_breadcrumbs:" + doctype];
},
async add(module, doctype, type) {
add(module, doctype, type) {
let obj;
if (typeof module === "object") {
obj = module;
@ -40,7 +40,6 @@ frappe.breadcrumbs = {
type: type,
};
}
await frappe.model.with_doctype(doctype);
this.all[frappe.breadcrumbs.current_page()] = obj;
this.update();
},
@ -185,12 +184,11 @@ frappe.breadcrumbs = {
}
},
async rename(doctype, old_name, new_name) {
rename(doctype, old_name, new_name) {
var old_route_str = ["Form", doctype, old_name].join("/");
var new_route_str = ["Form", doctype, new_name].join("/");
this.all[new_route_str] = this.all[old_route_str];
delete frappe.breadcrumbs.all[old_route_str];
await frappe.model.with_doctype(doctype);
this.update();
},