fix: sorting
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
import type { Post } from "../../bindings/app/internal/services";
|
||||
import type { IService } from "../types/service.type.ts";
|
||||
import type {SortOptions} from "../types/sort-options.type.ts";
|
||||
import {SortField} from "../../bindings/app/internal/utils";
|
||||
|
||||
export default class PostService implements IService<Post> {
|
||||
async read(id: number) {
|
||||
@@ -36,6 +37,6 @@ export default class PostService implements IService<Post> {
|
||||
}
|
||||
|
||||
async sort(options: SortOptions<Post>) {
|
||||
return await SortedByOrder(options) as Post[]
|
||||
return await SortedByOrder(Object.entries(options).map(item => ({Name: item[0], Order: item[1]}))) as Post[]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user