refactor(ocp): lots of work for rfid and dyco contorl

This commit is contained in:
2025-03-27 21:12:22 -05:00
parent 27d6b6e884
commit ba3d721940
19 changed files with 360 additions and 162 deletions

View File

@@ -1,4 +1,4 @@
import { desc, lte, sql } from "drizzle-orm";
import { desc, gte, lte, sql } from "drizzle-orm";
import { db } from "../../../../../database/dbclient.js";
import { prodlabels } from "../../../../../database/schema/prodLabels.js";
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
@@ -8,7 +8,7 @@ export const getLabels = async (hours: string) => {
.select()
.from(prodlabels)
.where(
lte(
gte(
prodlabels.upd_date,
sql.raw(`NOW() - INTERVAL '${hours} hours'`)
)
@@ -27,6 +27,7 @@ export const getLabels = async (hours: string) => {
return {
success: true,
message: "Current labels order by upd_Date.",
count: labelInfo.length,
data: labelInfo,
};
};