import { db } from "../../../../database/dbclient.js";
import { prodPermissions } from "../../../../database/schema/prodPermissions.js";
import { tryCatch } from "../../../globalUtils/tryCatch.js";

export const getProdRoles = async () => {
    const { data, error } = (await tryCatch(
        db.select().from(prodPermissions)
    )) as any;

    if (error) {
        return {
            success: false,
            message: "Error getting prod permissions",
            data: error,
        };
    }

    return {
        success: true,
        message: "Current prod permissions",
        data: data,
    };
};
