Open Nandita-Kumari opened 9 months ago
Hi you might want to check your code in /app/(root)/create-thread/page.tsx. It should be:
import PostThread from '@/components/forms/PostThread';
import { fetchUser } from '@/lib/actions/user.actions';
import { currentUser } from '@clerk/nextjs';
import { redirect } from 'next/navigation';
async function Page() {
const user = await currentUser();
if(!user) return null;
// fetch organization list created by user
const userInfo = await fetchUser(user.id);
if (!userInfo?.onboarded) redirect("/onboarding"); // move all the users that maybe switch their url bar manually, it will bring them back to onboarding
return (
<>
<h1 className='head-text'>Create Thread</h1>
<PostThread userId={userInfo._id} />
</>
);
}
export default Page;
Hello, did u get it to work btw? Facing the same problem
Whenever i click on Post thread button, it throws error of invalid url in the UI.