mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-30 09:03:15 +00:00
(feat:docs) sort
This commit is contained in:
@@ -3,9 +3,12 @@ import userService from '../api/services/userService';
|
||||
import { Doc } from '../models/misc';
|
||||
|
||||
//Fetches all JSON objects from the source. We only use the objects with the "model" property in SelectDocsModal.tsx. Hopefully can clean up the source file later.
|
||||
export async function getDocs(): Promise<Doc[] | null> {
|
||||
export async function getDocs(
|
||||
sort = 'date',
|
||||
order = 'desc',
|
||||
): Promise<Doc[] | null> {
|
||||
try {
|
||||
const response = await userService.getDocs();
|
||||
const response = await userService.getDocs(sort, order);
|
||||
const data = await response.json();
|
||||
|
||||
const docs: Doc[] = [];
|
||||
|
||||
Reference in New Issue
Block a user