24 lines
661 B
TypeScript
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,
|
|
};
|
|
};
|