"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = useSaveMenuConfig;
const axiosInstance_1 = require("../../../axiosInstance");
function useSaveMenuConfig() {
    const handleSaveMenuConfig = async ({ data, key }) => {
        await axiosInstance_1.PHXAxiosInstance.put(`${process.env.NEXT_PUBLIC_API_GATEWAY}/setting/setting-site`, {
            key,
            value: data,
        });
    };
    async function getSavedMenuConfig({ key }) {
        try {
            const { data: { data }, } = await axiosInstance_1.PHXAxiosInstance.get(`${process.env.NEXT_PUBLIC_API_GATEWAY}/setting/setting-site?key=${key}`);
            return data;
        }
        catch (e) {
            console.error(e);
            throw e;
        }
    }
    return { handleSaveMenuConfig, getSavedMenuConfig };
}
//# sourceMappingURL=use-save-menu-config.js.map