import {db} from "../../../../../database/dbclient.js";
import {settings} from "../../../../../database/schema/settings.js";
import {createLog} from "../../../logger/logger.js";

export const getSettings = async () => {
    createLog("info", "lst", "server", "Settings are being grabbed");
    let serverSettings;

    try {
        serverSettings = await db.select().from(settings);
        //.where(sql`${userRole} = ANY(roles)`);
    } catch (error) {
        createLog("error", "lst", "server", "There was an error getting the settings");
        throw new Error("There was an error getting the settings");
    }
    return serverSettings;
};
