feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain
This commit is contained in:
19
lstV2/server/services/ocp/controller/printers/getPrinters.ts
Normal file
19
lstV2/server/services/ocp/controller/printers/getPrinters.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { db } from "../../../../../database/dbclient.js";
|
||||
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
|
||||
import { printerData } from "../../../../../database/schema/printers.js";
|
||||
|
||||
export const getPrinters = async () => {
|
||||
const { data: printers, error: printerError } = await tryCatch(
|
||||
db.select().from(printerData).orderBy(printerData.name)
|
||||
);
|
||||
|
||||
if (printerError) {
|
||||
return {
|
||||
success: false,
|
||||
message: "there was an error getting the printers",
|
||||
data: printerError,
|
||||
};
|
||||
}
|
||||
|
||||
return { success: true, message: "Printers", data: printers };
|
||||
};
|
||||
Reference in New Issue
Block a user