From 2bac9d7a510c7e2cd307f29f275956b882644d5c Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Tue, 8 Nov 2022 12:29:46 +0000 Subject: [PATCH] Convert home to SSR from SSG --- app/(site)/page.tsx | 6 +++--- pages/api/gifs/index.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/(site)/page.tsx b/app/(site)/page.tsx index 6ed742f..8167638 100644 --- a/app/(site)/page.tsx +++ b/app/(site)/page.tsx @@ -1,11 +1,11 @@ import React from 'react'; import { Gif } from '@models'; -import { mapGif } from '@lib/mapping/gif'; -import client from '@lib/prismadb'; import { GifContainer } from '@components'; async function getGifs() { - const gifs = await fetch(`${process.env.API_URL}/api/gifs`); + const gifs = await fetch(`${process.env.API_URL}/api/gifs`, { + cache: 'no-store', + }); return await gifs.json(); } diff --git a/pages/api/gifs/index.ts b/pages/api/gifs/index.ts index 54f6d56..a91c934 100644 --- a/pages/api/gifs/index.ts +++ b/pages/api/gifs/index.ts @@ -1,5 +1,4 @@ import { NextApiRequest, NextApiResponse } from 'next'; -import { Gif } from '@models'; import { mapGif } from '@lib/mapping/gif'; import client from '@lib/prismadb'; const handler = async (req: NextApiRequest, res: NextApiResponse) => {