24 lines
712 B
TypeScript
24 lines
712 B
TypeScript
import { eq } from "drizzle-orm";
|
|
import { db } from "../../../../../database/dbclient.js";
|
|
import { labelRatio } from "../../../../../database/schema/ratios.js";
|
|
import { tryCatch } from "../../../../globalUtils/tryCatch.js";
|
|
export const getLabelRatio = async () => {
|
|
const { data: labelInfo, error: labelError } = await tryCatch(
|
|
db.select().from(labelRatio).where(eq(labelRatio.name, "label"))
|
|
);
|
|
|
|
if (labelError) {
|
|
return {
|
|
success: false,
|
|
message: "There was an error getting the labelratio",
|
|
data: [labelError],
|
|
};
|
|
}
|
|
|
|
return {
|
|
success: true,
|
|
message: "Current labelratio.",
|
|
data: labelInfo,
|
|
};
|
|
};
|