fix: sort result by creation

This commit is contained in:
Jannat Patel 2021-11-24 19:43:12 +05:30
parent 945084e195
commit 7cc6da2122
2 changed files with 2 additions and 2 deletions

View file

@ -128,7 +128,7 @@ async function check_if_single(doctype) {
async function get_first_document(doctype) {
let docname;
await frappe.db.get_list(doctype).then(res => {
await frappe.db.get_list(doctype, { order_by: "creation" }).then(res => {
if (Array.isArray(res) && res.length)
docname = res[0].name
});

View file

@ -571,7 +571,7 @@ export default class OnboardingWidget extends Widget {
let docname;
if (message.first_document) {
await frappe.db.get_list(doctype).then(res => {
await frappe.db.get_list(doctype, { order_by: "creation" }).then(res => {
if (Array.isArray(res) && res.length)
docname = res[0].name
});