fix(File): Remove extra API endpoint
Got rid of frappe.core.doctype.file.file.optimize_saved_image in favour of whitelisted Document Action File.optimize_file
This commit is contained in:
parent
bc596e9681
commit
75ff78e6bd
2 changed files with 3 additions and 12 deletions
|
|
@ -29,15 +29,9 @@ frappe.ui.form.on("File", "refresh", function(frm) {
|
|||
if (is_optimizable) {
|
||||
frm.add_custom_button(__("Optimize"), function() {
|
||||
frappe.show_alert(__("Optimizing image..."));
|
||||
frappe.call({
|
||||
method: "frappe.core.doctype.file.file.optimize_saved_image",
|
||||
args: {
|
||||
doc_name: frm.doc.name,
|
||||
},
|
||||
callback: function() {
|
||||
frappe.show_alert(__("Image optimized"));
|
||||
frappe.set_route("List", "File");
|
||||
}
|
||||
frm.call("optimize_file").then(() => {
|
||||
frappe.show_alert(__("Image optimized"));
|
||||
frappe.set_route("List", "File");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -979,9 +979,6 @@ def unzip_file(name):
|
|||
files = file_obj.unzip()
|
||||
return len(files)
|
||||
|
||||
@frappe.whitelist()
|
||||
def optimize_saved_image(doc_name):
|
||||
frappe.get_doc('File', doc_name).optimize_file()
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_attached_images(doctype, names):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue