swikarrr
swikarrr
TTCTheo's Typesafe Cult
Created by swikarrr on 7/9/2023 in #questions
Updated data not being fetched in production.
i just needed to revalidate the data fetching apparently it was calling the api for 1 time and then using that throughout so i added export const revalidate = 0; at top my route
8 replies
TTCTheo's Typesafe Cult
Created by swikarrr on 7/9/2023 in #questions
Updated data not being fetched in production.
thank you , but i got it it was happening because of caching
8 replies
TTCTheo's Typesafe Cult
Created by swikarrr on 7/9/2023 in #questions
Updated data not being fetched in production.
import { db } from "@/lib/db";
import { z } from "zod";

export async function GET(req: Request) {
try {
const votes = await db.vote.findMany();
return new Response(JSON.stringify(votes));
} catch (error) {
if (error instanceof z.ZodError) {
return new Response("Invalid request data passed", { status: 422 });
}

return new Response("Could not fetch the data.", {
status: 500,
});
}
}
import { db } from "@/lib/db";
import { z } from "zod";

export async function GET(req: Request) {
try {
const votes = await db.vote.findMany();
return new Response(JSON.stringify(votes));
} catch (error) {
if (error instanceof z.ZodError) {
return new Response("Invalid request data passed", { status: 422 });
}

return new Response("Could not fetch the data.", {
status: 500,
});
}
}
this one is route
8 replies
TTCTheo's Typesafe Cult
Created by swikarrr on 7/8/2023 in #questions
TypeScript
thank you
6 replies
TTCTheo's Typesafe Cult
Created by swikarrr on 7/8/2023 in #questions
TypeScript
thanks man t3ggLove
6 replies
TTCTheo's Typesafe Cult
Created by Mike on 6/27/2023 in #questions
Uploadthing and Clerk work together?
i don't think you need use any kind of auth for using upload thing.
11 replies