Kirik
TTCTheo's Typesafe Cult
•Created by Kirik on 8/5/2023 in #questions
'id' does not exist in type 'UseTRPCMutationOptions<{ id: string; title?: string | undefined; ...
Thanks! Javascript sure has a way of doing things. I appreciate the help 🙏
7 replies
TTCTheo's Typesafe Cult
•Created by Kirik on 5/4/2023 in #questions
Type 'string | null' is not assignable to type 'string | undefined'.
7 replies
TTCTheo's Typesafe Cult
•Created by Kirik on 4/27/2023 in #questions
Custom Nested DB schema defaults or empty help
create: privateProcedure
.input(
z.object({
content: z.string().emoji("Only emojis are allowed").min(1).max(280),
})
)
.mutation(async ({ ctx, input }) => {
const authorId = ctx.userId;
const { success } = await ratelimit.limit(authorId);
if (!success) throw new TRPCError({ code: "TOO_MANY_REQUESTS" });
const quest = await ctx.prisma.quest.create({
data: { authorId, title: input.content, rating: 1, rating_denominator:1, reward_xp:1, goal: "goal", target: new Date(), description: "description",
}, });
return quest; }),
const { success } = await ratelimit.limit(authorId);
if (!success) throw new TRPCError({ code: "TOO_MANY_REQUESTS" });
const quest = await ctx.prisma.quest.create({
data: { authorId, title: input.content, rating: 1, rating_denominator:1, reward_xp:1, goal: "goal", target: new Date(), description: "description",
}, });
return quest; }),
3 replies
TTCTheo's Typesafe Cult
•Created by Kirik on 4/26/2023 in #questions
:x: tRPC failed on posts.create: Unauthorized -- from T3 Stack Tutorial tutorial
Solved! Except for the styles :/
6 replies
TTCTheo's Typesafe Cult
•Created by Kirik on 4/26/2023 in #questions
:x: tRPC failed on posts.create: Unauthorized -- from T3 Stack Tutorial tutorial
AHA It was invalid upstash credentials. my token was set to masked * and not the actual secret
6 replies
TTCTheo's Typesafe Cult
•Created by Kirik on 4/26/2023 in #questions
:x: tRPC failed on posts.create: Unauthorized -- from T3 Stack Tutorial tutorial
narrowed it down to
const { success } = await ratelimit.limit(authorId);
6 replies