diff --git a/.env b/.env new file mode 100644 index 0000000..ca618c9 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +NEXT_PRIVATE_DEBUG_CACHE=1 diff --git a/api/index.ts b/api/index.ts index ed5103f..c970bde 100644 --- a/api/index.ts +++ b/api/index.ts @@ -27,6 +27,7 @@ export async function authenticateLottery(phone: string, code: string) { const result = await res.json(); + console.log("Data fetched successfully " + res.status); return result; } catch (err) { console.log(err); @@ -34,6 +35,6 @@ export async function authenticateLottery(phone: string, code: string) { } } -export const revalidateTagName = (tag: string) => { +export const revalidateTagName = async (tag: string) => { revalidateTag(tag); }; diff --git a/api/queries.ts b/api/queries.ts index 1f09248..65b51c8 100644 --- a/api/queries.ts +++ b/api/queries.ts @@ -22,6 +22,7 @@ import { VideoModel } from "@/models/video.model"; import { VideosModel } from "@/models/videos.model"; import { IVote } from "@/models/vote.model"; import routes from "@/routes"; +import { revalidateTag } from "next/cache"; import { cookies } from "next/headers"; export class Queries { @@ -270,7 +271,12 @@ export const getTossData = async ({ id: string; }) => { try { - const res = await fetch(`${baseUrl.QUIZ_SRC}${routes.tossId(type, id)}`); + const res = await fetch(`${baseUrl.QUIZ_SRC}${routes.tossId(type, id)}`, { + next: { + revalidate: 300, + tags: ["lotteryData"], + }, + }); if (!res.ok) { return undefined; diff --git a/next.config.js b/next.config.js index 78e2f0a..edd51af 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,5 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - output: "standalone", reactStrictMode: false, images: { diff --git a/package.json b/package.json index bb75d95..22f7e78 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev -p 4000", + "dev": "next dev --turbopack -p 4000", "build": "next build", "start": "next start", "lint": "next lint" @@ -22,8 +22,8 @@ "@tanstack/react-query": "^4.32.0", "@tanstack/react-query-devtools": "^4.32.0", "@types/node": "18.15.13", - "@types/react": "^18.2.15", - "@types/react-dom": "18.0.11", + "@types/react": "19.0.8", + "@types/react-dom": "19.0.3", "@types/uuid": "^9.0.1", "autoprefixer": "10.4.14", "axios": "^1.5.1", @@ -33,13 +33,13 @@ "dayjs": "^1.11.7", "framer-motion": "^10.12.16", "lucide-react": "^0.408.0", - "next": "^14.1.0", + "next": "15.1.6", "next-seo": "^6.0.0", "postcss": "8.4.23", - "react": "^18.2.0", + "react": "19.0.0", "react-confetti": "^6.1.0", "react-day-picker": "^8.10.1", - "react-dom": "^18.2.0", + "react-dom": "19.0.0", "react-fast-marquee": "^1.3.5", "react-hook-form": "^7.54.2", "react-icons": "^4.8.0", @@ -60,6 +60,10 @@ "devDependencies": { "@types/date-fns": "^2.6.0", "eslint": "8.49.0", - "eslint-config-next": "^14.1.0" + "eslint-config-next": "15.1.6" + }, + "overrides": { + "@types/react": "19.0.8", + "@types/react-dom": "19.0.3" } }