diff --git a/src/app/api/cache-revalidate/route.ts b/src/app/api/cache-revalidate/route.ts new file mode 100644 index 0000000..a7be656 --- /dev/null +++ b/src/app/api/cache-revalidate/route.ts @@ -0,0 +1,17 @@ +import { revalidateTag } from 'next/cache'; +import { NextResponse } from 'next/server'; + +import { FetchTags } from '@/shared/api/tags'; + +export async function GET() { + try { + revalidateTag(FetchTags.TAYLOR); + + return NextResponse.json({ success: true }); + } catch (err) { + return NextResponse.json( + { error: 'Failed to revalidate', detail: err }, + { status: 500 }, + ); + } +} diff --git a/src/shared/api/tags.ts b/src/shared/api/tags.ts new file mode 100644 index 0000000..cc42395 --- /dev/null +++ b/src/shared/api/tags.ts @@ -0,0 +1,3 @@ +export enum FetchTags { + TAYLOR = 'taylor', +} diff --git a/src/shared/api/taylor-api.ts b/src/shared/api/taylor-api.ts index 200a98c..7a13d6a 100644 --- a/src/shared/api/taylor-api.ts +++ b/src/shared/api/taylor-api.ts @@ -1,10 +1,15 @@ import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; +import { FetchTags } from './tags'; + const baseQuery = fetchBaseQuery({ baseUrl: process.env.TAYLOR_API_ENDPOINT, headers: { Authorization: process.env.TAYLOR_API_TOKEN || '', }, + next: { + tags: [FetchTags.TAYLOR], + }, }); export const taylorAPI = createApi({ diff --git a/src/widgets/partners-section.tsx b/src/widgets/partners-section.tsx index 399eb9c..ccf7cfa 100644 --- a/src/widgets/partners-section.tsx +++ b/src/widgets/partners-section.tsx @@ -1,6 +1,7 @@ 'use client'; import { Handshake } from 'lucide-react'; +import Link from 'next/link'; import { useMemo } from 'react'; import { Partners } from '@/app/api-utlities/@types'; @@ -9,7 +10,6 @@ import { useTextController } from '@/shared/language/hooks/use-text-controller'; import { Button } from '@/shared/shadcn-ui/button'; import { PartnersSlider } from './partners-slider'; -import Link from 'next/link'; interface PartnersSectionProps { partners: Partners; @@ -62,7 +62,11 @@ export const PartnersSection = ({ partners }: PartnersSectionProps) => {

{t('home.partners.becomePartnerText')}

- +