Files
lstV2/server/services/ocp/controller/lots/lots.ts

24 lines
661 B
TypeScript

import { tryCatch } from "../../../../globalUtils/tryCatch.js";
import { query } from "../../../sqlServer/prodSqlServer.js";
import { lotQuery } from "../../../sqlServer/querys/ocp/lots.js";
export const getLots = async () => {
const { data: lotInfo, error: lotError } = await tryCatch(
query(lotQuery, "Alplalabel online lots")
);
if (lotError) {
return {
success: false,
message: "There was an error getting the lots",
data: lotError,
};
}
return {
success: true,
message: "Current active lots that are technically released.",
data: lotInfo,
};
};