feat(ocp): added in printers get and add

This commit is contained in:
2025-03-25 12:47:15 -05:00
parent 04eb2e3e14
commit f90066c090
15 changed files with 4990 additions and 6 deletions

View File

@@ -0,0 +1,21 @@
import { db } from "../../../../database/dbclient.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";
import { printers } from "../../../../database/schema/printers.js";
export const getPrinters = async () => {
const currentTime = new Date(Date.now());
const { data: printerData, error: printerError } = await tryCatch(
db.select().from(printers)
);
if (printerError) {
return {
success: false,
message: "there was an error getting the printers",
data: printerError,
};
}
return { success: true, message: "Printers", data: printerData };
};