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