sheng2808
sheng2808
TTCTheo's Typesafe Cult
Created by gave_one on 8/8/2023 in #questions
I have TRPC question/problem
probably changed the schema but didnt push properly?
6 replies
TTCTheo's Typesafe Cult
Created by gave_one on 8/8/2023 in #questions
I have TRPC question/problem
npx prisma db push, restart your ide, should fix it
6 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 6/20/2023 in #questions
Prisma Transaction not executing properly in a Production environment
2 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 6/1/2023 in #questions
upload thing jest
import React from "react";
import { render, fireEvent } from "@testing-library/react";
import { UploadButton } from "@uploadthing/react";
import { OurFileRouter } from "~/app/api/uploadthing/core";

describe("UploadButton", () => {
it("should trigger client upload complete callback when upload is completed", () => {
// Mock the onClientUploadComplete callback
const onClientUploadCompleteMock = jest.fn();

// Render the component
const { getByText } = render(
<UploadButton<OurFileRouter>
endpoint="imageUploader"
multiple={false}
onClientUploadComplete={onClientUploadCompleteMock}
onUploadError={jest.fn()} // Mock the onUploadError callback
/>
);

// Simulate an upload completion event
fireEvent.click(getByText("Upload"));

// Assert that the onClientUploadComplete callback has been called
expect(onClientUploadCompleteMock).toHaveBeenCalled();
});

// Add more test cases as needed
});
import React from "react";
import { render, fireEvent } from "@testing-library/react";
import { UploadButton } from "@uploadthing/react";
import { OurFileRouter } from "~/app/api/uploadthing/core";

describe("UploadButton", () => {
it("should trigger client upload complete callback when upload is completed", () => {
// Mock the onClientUploadComplete callback
const onClientUploadCompleteMock = jest.fn();

// Render the component
const { getByText } = render(
<UploadButton<OurFileRouter>
endpoint="imageUploader"
multiple={false}
onClientUploadComplete={onClientUploadCompleteMock}
onUploadError={jest.fn()} // Mock the onUploadError callback
/>
);

// Simulate an upload completion event
fireEvent.click(getByText("Upload"));

// Assert that the onClientUploadComplete callback has been called
expect(onClientUploadCompleteMock).toHaveBeenCalled();
});

// Add more test cases as needed
});
3 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 5/28/2023 in #questions
Should we still be using react hook form in nextjs 13?
ahh i see, okay found the cause that's breaking my button css, it's styling for uploadthing button 😅 '
7 replies
TTCTheo's Typesafe Cult
Created by sheng2808 on 5/28/2023 in #questions
Should we still be using react hook form in nextjs 13?
okay i realized that it's when the button type is "submit" the tailwind will become broken
7 replies
TTCTheo's Typesafe Cult
Created by niels on 5/5/2023 in #questions
Example repo, NextAuth with App Router
4 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 5/4/2023 in #questions
Type 'string | null' is not assignable to type 'string | undefined'.
if you want it to be null, add .nullable behind your zod input, if you want it to be undefined, then modify your quest so that it returns undefined when there is no description
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'.
where there is no quest description, you want it to be null or undefined?
7 replies
TTCTheo's Typesafe Cult
Created by Otar ✞ on 5/2/2023 in #questions
I got some cart synchronization issues, what would you do?
i just do a invalidate for mine
7 replies
TTCTheo's Typesafe Cult
Created by 低级黑小明👑 on 4/20/2023 in #questions
can't get query strings from context param
p.s. i'm still on an older version of trpc so my create helper name is different
20 replies
TTCTheo's Typesafe Cult
Created by 低级黑小明👑 on 4/20/2023 in #questions
can't get query strings from context param
my error was passing something else with ctx which messes with it
20 replies
TTCTheo's Typesafe Cult
Created by 低级黑小明👑 on 4/20/2023 in #questions
can't get query strings from context param
20 replies
TTCTheo's Typesafe Cult
Created by 低级黑小明👑 on 4/20/2023 in #questions
can't get query strings from context param
okay fixed it
20 replies
TTCTheo's Typesafe Cult
Created by 低级黑小明👑 on 4/20/2023 in #questions
can't get query strings from context param
the whole context is returning undefined apparently for me not just the slug
20 replies
TTCTheo's Typesafe Cult
Created by 低级黑小明👑 on 4/20/2023 in #questions
can't get query strings from context param
any idea how you fixed it?
20 replies
TTCTheo's Typesafe Cult
Created by 低级黑小明👑 on 4/20/2023 in #questions
can't get query strings from context param
i have the same issue now ._.
20 replies
TTCTheo's Typesafe Cult
Created by elpupper on 4/23/2023 in #questions
How can i remove the parameter
Glad to help :))
117 replies
TTCTheo's Typesafe Cult
Created by elpupper on 4/23/2023 in #questions
How can i remove the parameter
117 replies