refactor(ocp): change the way logs are brought in and other changes to clean the code up
This commit is contained in:
@@ -3,6 +3,7 @@ import { ocmeData } from "../../../../database/schema/ocme.js";
|
||||
import { differenceInMinutes } from "date-fns";
|
||||
import { createLog } from "../../logger/logger.js";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { timeZoneFix } from "../../../globalUtils/timeZoneFix.js";
|
||||
|
||||
export const getInfo = async () => {
|
||||
let ocmeInfo: any = [];
|
||||
@@ -16,7 +17,7 @@ export const getInfo = async () => {
|
||||
ocmeInfo = ocmeInfo.map((o: any) => {
|
||||
const now = new Date(Date.now());
|
||||
//const strippedDate = o.add_Date.replace("Z", "");
|
||||
const diff = differenceInMinutes(now, o.add_Date);
|
||||
const diff = differenceInMinutes(timeZoneFix(), o.add_Date);
|
||||
return { ...o, waitingFor: diff };
|
||||
});
|
||||
createLog(
|
||||
|
||||
Reference in New Issue
Block a user