Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post Thread Button not working #83

Open
Nandita-Kumari opened this issue Sep 21, 2023 · 2 comments
Open

Post Thread Button not working #83

Nandita-Kumari opened this issue Sep 21, 2023 · 2 comments

Comments

@Nandita-Kumari
Copy link

Whenever i click on Post thread button, it throws error of invalid url in the UI.

@dannweeeee
Copy link

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;

@ktk04
Copy link

ktk04 commented Feb 13, 2024

Hello, did u get it to work btw? Facing the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants