import axios from "@/config/axios";
import { SiteSettingResponse } from "@/app/privacy/types/Types";

export const getSiteSetting = async (
  name: string
): Promise<SiteSettingResponse> => {
  const params = new URLSearchParams();
  if (name !== "all") {
    params.append("name", name);
  }
  const { data } = await axios.get<SiteSettingResponse>(
    `/site-setting${params.toString() ? `?${params.toString()}` : ""}`
  );
  return data;
};
