2 Commits

Author SHA1 Message Date
305ac3dbf6 update imports 2025-04-19 13:20:10 +07:00
72569a0f75 fix: service template 2025-03-16 21:32:26 +07:00
2 changed files with 5 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ import { onMounted, reactive } from 'vue'
import { getDefaultValues } from '../utils/structs/defaults.util' import { getDefaultValues } from '../utils/structs/defaults.util'
import Service from './{{.LowerName}}.service' import Service from './{{.LowerName}}.service'
import type { Scheme } from '../types/scheme.type' import type { Scheme } from '../types/scheme.type'
import { {{.StructName}} } from '../../bindings/github.com/kuzgoga/nto-boilerplate/internal/services' import { {{.StructName}} } from '../../bindings/wails_tables/internal/services'
import { ref } from 'vue' import { ref } from 'vue'
import type { Validate } from "../types/validate.type"; import type { Validate } from "../types/validate.type";
import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util"; import { getDefaultSortOptions } from "../utils/structs/default-sort-options.util";

View File

@@ -1,5 +1,5 @@
import { GetAll, Create, Delete, GetById, Update, Count, SortedByOrder, SearchByAllTextFields } from "../../bindings/github.com/kuzgoga/nto-boilerplate/internal/services/{{.LowerModelName}}service" import { GetAll, Create, Delete, GetById, Update, Count, SortedByOrder, SearchByAllTextFields } from "../../bindings/wails_tables/internal/services/{{.LowerModelName}}service";
import type { {{.ModelName}} } from "../../bindings/github.com/kuzgoga/nto-boilerplate/internal/services" import type { {{.ModelName}} } from "../../bindings/wails_tables/internal/models";
import type { IService } from "../types/service.type" import type { IService } from "../types/service.type"
import type { SortOptions } from "../types/sort-options.type"; import type { SortOptions } from "../types/sort-options.type";
@@ -33,7 +33,7 @@ export default class {{.ModelName}}Service implements IService<{{.ModelName}}> {
return await SearchByAllTextFields(input) as {{ .ModelName }}[] return await SearchByAllTextFields(input) as {{ .ModelName }}[]
} }
async sort(options: SortOptions<Task>) { async sort(options: SortOptions<{{.ModelName}}>) {
return (await SortedByOrder( return (await SortedByOrder(
Object.entries(options).map((item) => { Object.entries(options).map((item) => {
if (item[1] !== 'NONE') { if (item[1] !== 'NONE') {
@@ -43,7 +43,6 @@ export default class {{.ModelName}}Service implements IService<{{.ModelName}}> {
}) })
} }
}).filter(item => !!item) }).filter(item => !!item)
)) as Task[]; )) as {{.ModelName}}[];
} }
} }
}