src/app/routes/article/utils/hasArticleRecommendations.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import getConfig from '#app/routes/utils/getConfig';

const hasArticleRecommendations = async (
  service: string,
  isAdvertising: boolean,
  variant?: string,
) => {
  const config = await getConfig(service, variant);

  const serviceHasRecommendations =
    config?.recommendations?.hasStoryRecommendations;

  return serviceHasRecommendations && isAdvertising;
};

export default hasArticleRecommendations;