fix: ensure that this.data is set in NumberCardWidget (#22527)
This commit is contained in:
parent
78934a5aa5
commit
4b1da7fe28
1 changed files with 4 additions and 5 deletions
|
|
@ -164,7 +164,7 @@ export default class NumberCardWidget extends Widget {
|
|||
}
|
||||
|
||||
this.settings = this.get_settings(this.card_doc.type);
|
||||
this.data = await this.get_data();
|
||||
await this.get_data();
|
||||
|
||||
this.render_number();
|
||||
this.render_stats();
|
||||
|
|
@ -176,10 +176,9 @@ export default class NumberCardWidget extends Widget {
|
|||
</div>`);
|
||||
}
|
||||
|
||||
get_data() {
|
||||
return frappe
|
||||
.xcall(this.settings.method, this.settings.args)
|
||||
.then((res) => this.settings.get_number(res));
|
||||
async get_data() {
|
||||
this.data = await frappe.xcall(this.settings.method, this.settings.args);
|
||||
return this.settings.get_number(this.data);
|
||||
}
|
||||
|
||||
get_number_for_custom_card(res) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue