mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-07 05:20:35 +07:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bff39d2c75 | ||
|
|
db5bf3bae0 |
@@ -34,6 +34,15 @@ export default class {{.ModelName}}Service implements IService<{{.ModelName}}> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async sort(options: SortOptions<{{ .ModelName }}>) {
|
async sort(options: SortOptions<{{ .ModelName }}>) {
|
||||||
return await SortedByOrder(Object.entries(options).map(item => ({Name: item[0], Order: item[1]}))) as {{ .ModelName }}[]
|
return (await SortedByOrder(
|
||||||
}
|
Object.entries(options).map((item) => {
|
||||||
|
if (item[1] !== 'NONE') {
|
||||||
|
return ({
|
||||||
|
Name: item[0],
|
||||||
|
Order: item[1],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).filter(item => !!item)
|
||||||
|
)) as {{ .ModelName }}[];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user