mirror of
https://github.com/opbnq-q/nto-cli.git
synced 2025-12-07 00:50:34 +07:00
Compare commits
1 Commits
199fe0a823
...
v1.0.4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db5bf3bae0 |
@@ -33,7 +33,17 @@ export default class {{.ModelName}}Service implements IService<{{.ModelName}}> {
|
|||||||
return await SearchByAllTextFields(input) as {{ .ModelName }}[]
|
return await SearchByAllTextFields(input) as {{ .ModelName }}[]
|
||||||
}
|
}
|
||||||
|
|
||||||
async sort(options: SortOptions<{{ .ModelName }}>) {
|
async sort(options: SortOptions<Task>) {
|
||||||
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 Task[];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user