import fetcher from "./fetcher";

interface ITermsAndConditionsResponse extends Object {

  termsAndConditions: IMarkdown;
}

export const getTermsAndConditions = async (): Promise<ITermsAndConditionsResponse> => {
  const query = `/terms-and-conditions?populate=*`;
  const response = await fetcher<IApiResponse<ITermsAndConditionsResponse>>(query);

  const item = response.data[0];
  return { termsAndConditions: item.termsAndConditions };
};
