Matt
Matt
TTCTheo's Typesafe Cult
Created by Matt on 11/29/2023 in #questions
Google sheet api / scaleable api
How can i make a api that can handle 100 post requests at a time. This is a expensive function that does a lot of querys to prisma db. It will also have to be rate limited. I would love to send 100 post requests and it tells the 4th request to wait 60 seconds, the 8th request 120 seconds, 12th request 150 seconds etc Does anyone have tips on google sheetapi, when i get row values, find row index that existing row is on, and update. sometimes a different edit happens on the google sheet and the row index is now incorrect updating the wrong row, losing values. How can i search a google sheet for a row with a phone number in a column if i find it update that row to new values, if i dont create a new row
41 replies
TTCTheo's Typesafe Cult
Created by Matt on 10/20/2023 in #questions
openapi
Please help me setup openAPI on this fresh app repo export const createTRPCContext = async (opts: { req: NextRequest }) => { // Fetch stuff that depends on the request return await createInnerTRPCContext({ headers: opts.req.headers, }); }; the problem is coming from here and the file in [...trpc] in api pages folder. When i call createContext req doesnt have the types i need https://github.com/MaW000/elite-f-rr
2 replies
TTCTheo's Typesafe Cult
Created by Matt on 7/14/2023 in #questions
TRPC functions vercel deploy
https://github.com/c-ehrlich/you-dont-need-callers/blob/main/src/server/api/example1-one-file/product.ts im doing this why does it seem like prisma does not work at all in the functions when i deploy to vercel. locally it works but when i deploy to vercel im not seeing console.log. it runs the function it just doesnt use prisma right
import { PrismaClient } from "@prisma/client";
import { env } from "@/env.mjs";

const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined;
};

export const prisma =
globalForPrisma.prisma ??
new PrismaClient({
log:
env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],
});

export type Prisma = typeof prisma;

if (env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
import { PrismaClient } from "@prisma/client";
import { env } from "@/env.mjs";

const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined;
};

export const prisma =
globalForPrisma.prisma ??
new PrismaClient({
log:
env.NODE_ENV === "development" ? ["query", "error", "warn"] : ["error"],
});

export type Prisma = typeof prisma;

if (env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
something to do with this?
3 replies
TTCTheo's Typesafe Cult
Created by Matt on 6/28/2023 in #questions
Mutation alters user in database then redirects to homepage. How can i force user session to update
I have a page /form when i press the submit button i activate a mutation that updates a field on user to true it then redirects to "/". When it redirects it does not update the ui and show green arrows for that form. I have to refresh page for the updated user object to come in with that field set to true. even tho it is true when i am redirected and i see red arrows indicating its false in database
6 replies
TTCTheo's Typesafe Cult
Created by Matt on 3/19/2023 in #questions
adding vercel vitals to CSP
next.config.mjs headers: async () => { return [ { source: "/(.*)", headers: [ { key: "Content-Security-Policy", value: "default-src 'self'; img-src 'self' data: vitals.vercel-insights.com", }, ], }, ]; }, }; Is there a different way of adding this. When i refresh my page it bugs out.
1 replies
TTCTheo's Typesafe Cult
Created by Matt on 3/11/2023 in #questions
next script / _document
1 replies
TTCTheo's Typesafe Cult
Created by Matt on 3/11/2023 in #questions
Pusher integration
1 replies
TTCTheo's Typesafe Cult
Created by Matt on 1/26/2023 in #questions
Next/Script
1 replies
TTCTheo's Typesafe Cult
Created by Matt on 1/18/2023 in #questions
How to search for msgs that include a string
1 replies
TTCTheo's Typesafe Cult
Created by Matt on 1/17/2023 in #questions
Prisma creating data twice
2 replies
TTCTheo's Typesafe Cult
Created by Matt on 12/8/2022 in #questions
intellisense
4 replies
TTCTheo's Typesafe Cult
Created by Matt on 11/26/2022 in #questions
eslint & tailwind intellisense issue
1 replies
TTCTheo's Typesafe Cult
Created by Matt on 11/5/2022 in #questions
tailwind intellisense
Have not been able to get this working for the last day on any project using any config. I feel like the issue has to be with my vsc or some other extension causing it to crash
7 replies