import { apiCall } from "@open-mercato/ui/backend/utils/apiCall";
import { createLogger } from "@open-mercato/shared/lib/logger";
const logger = createLogger("catalog");
async function fetchOptionSchemaTemplate(id) {
  if (!id) return null;
  try {
    const res = await apiCall(
      `/api/catalog/option-schemas?id=${encodeURIComponent(id)}&page=1&pageSize=1`
    );
    if (!res.ok) return null;
    const record = Array.isArray(res.result?.items) ? res.result?.items?.[0] : null;
    return record ?? null;
  } catch (err) {
    logger.error("catalog.option-schemas.fetch-one failed", { err });
    return null;
  }
}
export {
  fetchOptionSchemaTemplate
};
//# sourceMappingURL=optionSchemaClient.js.map
