mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 11:56:08 +08:00
修改依赖管理默认排序
This commit is contained in:
parent
e4ad8f512e
commit
144b543091
|
@ -125,8 +125,11 @@ export default class DependenceService {
|
||||||
return docs;
|
return docs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async find(query: any, sort?: any): Promise<Dependence[]> {
|
private async find(query: any, sort: any = []): Promise<Dependence[]> {
|
||||||
const docs = await DependenceModel.findAll({ where: { ...query } });
|
const docs = await DependenceModel.findAll({
|
||||||
|
where: { ...query },
|
||||||
|
order: [...sort, ['createdAt', 'DESC']],
|
||||||
|
});
|
||||||
return docs;
|
return docs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,10 @@ export default class EnvService {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const result = await this.find(condition, [['position', 'DESC']]);
|
const result = await this.find(condition, [
|
||||||
|
['position', 'DESC'],
|
||||||
|
['createdAt', 'DESC'],
|
||||||
|
]);
|
||||||
return result as any;
|
return result as any;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw error;
|
throw error;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user