refactor(ocp): change the way logs are brought in and other changes to clean the code up
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { and, eq, gte, inArray, lte, sql } from "drizzle-orm";
|
||||
import { and, desc, eq, gte, inArray, lte, sql } from "drizzle-orm";
|
||||
import { db } from "../../../../database/dbclient.js";
|
||||
import { logs } from "../../../../database/schema/logs.js";
|
||||
import { createLog } from "../logger.js";
|
||||
@@ -21,7 +21,8 @@ export const getLogs = async (data: any) => {
|
||||
inArray(logs.level, data.level),
|
||||
eq(logs.checked, checked)
|
||||
)
|
||||
);
|
||||
)
|
||||
.orderBy(desc(logs.created_at));
|
||||
|
||||
return { success: true, message: "logs returned", data: logData };
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user