diff --git a/generation/templates/service.tmpl b/generation/templates/service.tmpl index 513d77e..96ab790 100644 --- a/generation/templates/service.tmpl +++ b/generation/templates/service.tmpl @@ -33,7 +33,17 @@ export default class {{.ModelName}}Service implements IService<{{.ModelName}}> { return await SearchByAllTextFields(input) as {{ .ModelName }}[] } - async sort(options: SortOptions<{{ .ModelName }}>) { - return await SortedByOrder(Object.entries(options).map(item => ({Name: item[0], Order: item[1]}))) as {{ .ModelName }}[] - } + async sort(options: SortOptions) { + return (await SortedByOrder( + Object.entries(options).map((item) => { + if (item[1] !== 'NONE') { + return ({ + Name: item[0], + Order: item[1], + }) + } + }).filter(item => !!item) + )) as Task[]; + } +} } \ No newline at end of file